Reviewers: golang-dev_googlegroups.com,
Message:
Hello golang-dev@googlegroups.com,
I'd like you to review this change to
https://go.googlecode.com/hg/
Description:
cmd/gc: don't require that slice index constants be small ints
The test for this is test/index.go, which is not run by
default.
Please review this at http://codereview.appspot.com/6812089/
Affected files:
M src/cmd/gc/walk.c
Index: src/cmd/gc/walk.c
===================================================================
--- a/src/cmd/gc/walk.c
+++ b/src/cmd/gc/walk.c
@@ -2477,14 +2477,14 @@
if(isconst(hb, CTINT)) {
hbv = mpgetfix(hb->val.u.xval);
- if(hbv < 0 || hbv > bv || !smallintconst(hb)) {
+ if(hbv < 0 || hbv > bv) {
yyerror("slice index out of bounds");
hbv = -1;
}
}
if(isconst(lb, CTINT)) {
lbv = mpgetfix(lb->val.u.xval);
- if(lbv < 0 || lbv > bv || !smallintconst(lb)) {
+ if(lbv < 0 || lbv > bv) {
yyerror("slice index out of bounds");
lbv = -1;
}