Commit dc30800c authored by Russ Cox's avatar Russ Cox

8g: call throwindex for array out of bounds

R=ken2
https://golang.org/cl/160043
parent 6e0842db
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment