changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/cmd/forp/cvt.c

revision 6943: a62d8d9eda33
parent 6451: e44fe511726c
     1.1--- a/sys/src/cmd/forp/cvt.c
     1.2+++ b/sys/src/cmd/forp/cvt.c
     1.3@@ -251,9 +251,9 @@ opidx(Node *rn, Node *n1, Node *n2, Node
     1.4 {
     1.5 	int i, j, k, s;
     1.6 	
     1.7-	j = mptoi(n2->num);
     1.8-	if(n3 == nil) k = j;
     1.9-	else k = mptoi(n3->num);
    1.10+	k = mptoi(n2->num);
    1.11+	if(n3 == nil) j = k;
    1.12+	else j = mptoi(n3->num);
    1.13 	if(j > k){
    1.14 		nodevars(rn, 1);
    1.15 		return;
    1.16@@ -492,7 +492,7 @@ convert(Node *n, uint sz)
    1.17 	case ASTIDX:
    1.18 		if(n->n2->type != ASTNUM || n->n3 != nil && n->n3->type != ASTNUM)
    1.19 			error(n, "non-constant in indexing expression");
    1.20-		convert(n->n1, (n->n3 != nil ? mptoi(n->n3->num) : mptoi(n->n2->num)) + 1);
    1.21+		convert(n->n1, n->n3 != nil ? mptoi(n->n3->num) - mptoi(n->n2->num) + 1 : 1);
    1.22 		opidx(n, n->n1, n->n2, n->n3);
    1.23 		break;
    1.24 	case ASTTERN: