Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(162)

Issue 6783054: code review 6783054: cmd/gc: do simple bounds checking of constant indices/s... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 3 months ago by DMorsing
Modified:
9 years, 2 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

cmd/gc: do simple bounds checking of constant indices/slices in typecheck. This should make the compiler emit errors specific to the bounds checking instead of overflow errors on the underlying types. Updates issue 4232.

Patch Set 1 #

Patch Set 2 : diff -r 024dde07c08d https://code.google.com/p/go/ #

Patch Set 3 : diff -r 024dde07c08d https://code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r 7d691a2266ef https://code.google.com/p/go/ #

Total comments: 1

Patch Set 5 : diff -r 632ca9d98436 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -2 lines) Patch
M src/cmd/gc/typecheck.c View 1 2 3 4 3 chunks +15 lines, -2 lines 0 comments Download

Messages

Total messages: 6
DMorsing
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 3 months ago (2012-10-26 20:05:20 UTC) #1
rsc
Thanks for working on this. https://codereview.appspot.com/6783054/diff/1002/src/cmd/gc/typecheck.c File src/cmd/gc/typecheck.c (right): https://codereview.appspot.com/6783054/diff/1002/src/cmd/gc/typecheck.c#newcode827 src/cmd/gc/typecheck.c:827: yyerror("slice/array index must be ...
9 years, 2 months ago (2012-11-01 16:54:25 UTC) #2
DMorsing
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
9 years, 2 months ago (2012-11-01 17:13:32 UTC) #3
DMorsing
Whoops, a bit too fast on the trigger. Anyway, both suggestions done.
9 years, 2 months ago (2012-11-01 17:14:41 UTC) #4
rsc
LGTM https://codereview.appspot.com/6783054/diff/9001/src/cmd/gc/typecheck.c File src/cmd/gc/typecheck.c (right): https://codereview.appspot.com/6783054/diff/9001/src/cmd/gc/typecheck.c#newcode827 src/cmd/gc/typecheck.c:827: yyerror("invalid array/slice index %N (index must be non-negative)", ...
9 years, 2 months ago (2012-11-01 17:24:11 UTC) #5
DMorsing
9 years, 2 months ago (2012-11-01 17:45:26 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=da736dff5c27 ***

cmd/gc: do simple bounds checking of constant indices/slices in typecheck.

This should make the compiler emit errors specific to the bounds checking
instead of overflow errors on the underlying types.

Updates issue 4232.

R=rsc
CC=golang-dev
http://codereview.appspot.com/6783054
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b