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

Issue 102820043: code review 102820043: cmd/gc: fix x=x crash

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by rsc
Modified:
11 years, 10 months ago
Reviewers:
r, gobot, khr
CC:
golang-codereviews, r, khr, iant
Visibility:
Public.

Description

cmd/gc: fix x=x crash The 'nodarg' function is used to obtain a Node* representing a function argument or result. It returned a brand new Node*, but that violates the guarantee in most places in the compiler that two Node*s refer to the same variable if and only if they are the same Node* pointer. Reestablish that invariant by making nodarg return a preexisting named variable if present. Having fixed that, avoid any copy during x=x in componentgen, because the VARDEF we emit before the copy marks the lhs x as dead incorrectly. The change in walk.c avoids modifying the result of nodarg. This was the only place in the compiler that did so. Fixes issue 8097.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -1 line) Patch
M src/cmd/5g/cgen.c View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M src/cmd/6g/cgen.c View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M src/cmd/6g/gsubr.c View 1 2 chunks +9 lines, -0 lines 0 comments Download
M src/cmd/8g/cgen.c View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M src/cmd/gc/walk.c View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M test/live.go View 1 2 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 8
rsc
Hello golang-codereviews@googlegroups.com (cc: iant, khr, r), I'd like you to review this change to https://code.google.com/p/go/
11 years, 10 months ago (2014-05-28 21:18:54 UTC) #1
r
LGTM but i am not an expert here
11 years, 10 months ago (2014-05-28 21:23:36 UTC) #2
khr
On 2014/05/28 21:23:36, r wrote: > LGTM but i am not an expert here LGTM.
11 years, 10 months ago (2014-05-28 22:13:47 UTC) #3
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=b0ce6dbafc18 *** cmd/gc: fix x=x crash The 'nodarg' function is used to ...
11 years, 10 months ago (2014-05-28 23:50:22 UTC) #4
gobot
This CL appears to have broken the darwin-386-cheney builder. See http://build.golang.org/log/006cd9eed21c968b522602c7d9f09d0eeb626323
11 years, 10 months ago (2014-05-28 23:56:14 UTC) #5
r
The breakage looks real and 386-specific On Wed, May 28, 2014 at 4:56 PM, <gobot@golang.org> ...
11 years, 10 months ago (2014-05-29 00:09:08 UTC) #6
rsc
Looking...
11 years, 10 months ago (2014-05-29 00:12:35 UTC) #7
rsc
11 years, 10 months ago (2014-05-29 01:43:45 UTC) #8
It's a complete mystery. I'll roll this back and try again in the morning. 
Sign in to reply to this message.

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