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

Issue 6542060: code review 6542060: cmd/gc: don't dereference a nil Type pointer in widstruct (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by akumar
Modified:
12 years, 8 months ago
Reviewers:
CC:
rsc, minux1, golang-dev
Visibility:
Public.

Description

cmd/gc: don't dereference a nil Type pointer in widstruct The nil dereference in the next few lines doesn't seem to cause a segmentation fault on Unix, but does seem to halt the Go compiler. The following is a test case: >>> package main func mine(int b) int { return b + 2 } func main() { mine() c = mine() } <<< Without this change only the following is caught: typecheck.go:3: undefined: b typecheck.go:4: undefined: b with it, we catch all the errors: typecheck.go:3: undefined: b typecheck.go:4: undefined: b typecheck.go:10: undefined: c typecheck.go:10: cannot assign to c .

Patch Set 1 #

Patch Set 2 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 53a8e1ce580e https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 53a8e1ce580e https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -0 lines) Patch
M src/cmd/gc/align.c View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A test/typecheck.go View 1 2 3 4 5 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 12
akumar
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 9 months ago (2012-09-23 05:06:56 UTC) #1
akumar
I just realized that, that is perhaps not the best place to end the loop. ...
12 years, 9 months ago (2012-09-23 06:46:19 UTC) #2
akumar
Just to update the message for convenience, the new diff is: Index: src/cmd/gc/align.c =================================================================== --- ...
12 years, 9 months ago (2012-09-23 20:36:10 UTC) #3
akumar
ping? On 23 September 2012 13:36, <seed@mail.nanosouffle.net> wrote: > Just to update the message for ...
12 years, 9 months ago (2012-09-24 12:34:21 UTC) #4
minux1
you need to at least make a test for it. See tests under /test/ for ...
12 years, 9 months ago (2012-09-24 12:52:58 UTC) #5
akumar
PTAL. On 2012/09/24 12:52:58, minux wrote: > you need to at least make a test ...
12 years, 9 months ago (2012-10-03 00:47:53 UTC) #6
rsc
The test as written won't work for gccgo. Can you use an errorcheck test instead ...
12 years, 8 months ago (2012-10-05 20:39:38 UTC) #7
akumar
PTAL. On 2012/10/05 20:39:38, rsc wrote: > The test as written won't work for gccgo. ...
12 years, 8 months ago (2012-10-05 21:23:25 UTC) #8
rsc
LGTM
12 years, 8 months ago (2012-10-06 22:27:00 UTC) #9
minux1
*** Submitted as http://code.google.com/p/go/source/detail?r=035960d0711f *** cmd/gc: don't dereference a nil Type pointer in widstruct The ...
12 years, 8 months ago (2012-10-07 06:12:14 UTC) #10
akumar
*** Abandoned ***
12 years, 8 months ago (2012-10-24 01:41:38 UTC) #11
akumar
12 years, 8 months ago (2012-10-24 02:09:40 UTC) #12
On 2012/10/24 01:41:38, akumar wrote:
> *** Abandoned ***

Ugh, this was actually submitted, then changed. I merged the changes locally
then did `hg sync', which asked me to do `hg change -d 6542060'. My apologies
for listening to mercurial.
Sign in to reply to this message.

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