mirror of
https://github.com/golang/go.git
synced 2024-09-30 14:57:10 +00:00
8g: call throwindex for array out of bounds
R=ken2 https://golang.org/cl/160043
This commit is contained in:
parent
6e0842db8b
commit
dc30800c28
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user