diff options
| author | Russ Cox <rsc@golang.org> | 2009-11-23 12:58:28 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-11-23 12:58:28 -0800 |
| commit | 7115d52e0261a407fa47ee65289b3710f8380e66 (patch) | |
| tree | 9b940eb296bca13647365613cd8035d66978a660 | |
| parent | de7d1c897894d848ca5c6db059cd5810484da875 (diff) | |
| download | golang-7115d52e0261a407fa47ee65289b3710f8380e66.tar.gz | |
8g: call throwindex for array out of bounds
R=ken2
http://codereview.appspot.com/160043
| -rw-r--r-- | src/cmd/8g/cgen.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cmd/8g/cgen.c b/src/cmd/8g/cgen.c index b6b855de8..cc93cf3e5 100644 --- a/src/cmd/8g/cgen.c +++ b/src/cmd/8g/cgen.c @@ -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); } |
