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

Issue 126570043: code review 126570043: cmd/gc: fix order of channel evaluation of receive channels (Closed)

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

Description

cmd/gc: fix order of channel evaluation of receive channels Normally, an expression of the form x.f or *y can be reordered with function calls and communications. Select is stricter than normal: each channel expression is evaluated in source order. If you have case <-x.f and case <-foo(), then if the evaluation of x.f causes a panic, foo must not have been called. (This is in contrast to an expression like x.f + foo().) Enforce this stricter ordering. Fixes issue 8336.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -0 lines) Patch
M src/cmd/gc/order.c View 1 2 chunks +8 lines, -0 lines 0 comments Download
A test/fixedbugs/issue8336.go View 1 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-codereviews@googlegroups.com (cc: dvyukov, r), I'd like you to review this change to https://code.google.com/p/go/
10 years, 8 months ago (2014-08-25 02:28:58 UTC) #1
dvyukov
LGTM
10 years, 8 months ago (2014-08-25 05:43:44 UTC) #2
rsc
10 years, 8 months ago (2014-08-25 11:05:41 UTC) #3
*** Submitted as https://code.google.com/p/go/source/detail?r=c29860623fb3 ***

cmd/gc: fix order of channel evaluation of receive channels

Normally, an expression of the form x.f or *y can be reordered
with function calls and communications.

Select is stricter than normal: each channel expression is evaluated
in source order. If you have case <-x.f and case <-foo(), then if the
evaluation of x.f causes a panic, foo must not have been called.
(This is in contrast to an expression like x.f + foo().)

Enforce this stricter ordering.

Fixes issue 8336.

LGTM=dvyukov
R=golang-codereviews, dvyukov
CC=golang-codereviews, r
https://codereview.appspot.com/126570043
Sign in to reply to this message.

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