FAQ
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;
}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 6, '12 at 12:53a
activeNov 6, '12 at 7:37p
posts4
users3
websitegolang.org

3 users in discussion

Iant: 2 posts Rsc: 1 post Remyoudompheng: 1 post

People

Translate

site design / logo © 2022 Grokbase