8g: call throwindex for array out of bounds

R=ken2
https://golang.org/cl/160043
This commit is contained in:
Russ Cox 2009-11-23 12:58:28 -08:00
parent 6e0842db8b
commit dc30800c28

View File

@ -548,8 +548,7 @@ agen(Node *n, Node *res)
nodconst(&n2, types[TUINT32], v);
gins(optoas(OCMP, types[TUINT32]), &n1, &n2);
p1 = gbranch(optoas(OGT, types[TUINT32]), T);
//ginscall(throwindex, 0);
gins(AINT, nodintconst(3), N);
ginscall(throwindex, 0);
patch(p1, pc);
}
@ -595,8 +594,7 @@ agen(Node *n, Node *res)
nodconst(&n1, types[TUINT32], nl->type->bound);
gins(optoas(OCMP, types[TUINT32]), &n2, &n1);
p1 = gbranch(optoas(OLT, types[TUINT32]), T);
//ginscall(throwindex, 0);
gins(AINT, nodintconst(3), N);
ginscall(throwindex, 0);
patch(p1, pc);
}