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

Issue 89750043: code review 89750043: ogle/program/server: clarify ordering of evaluation whe... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by nigeltao
Modified:
10 years ago
Reviewers:
r
CC:
r
Visibility:
Public.

Description

ogle/program/server: clarify ordering of evaluation when ptraceRun wraps a closure that 'returns' more than just an error. I don't think this changes the actual behavior with the gc compiler, but a different compiler might not optimize the "return foo" part as a no-op, in: func f() (foo int, err error) { etc return foo, <-s.ec } and then it's possibly racy whether foo is evaluated before or after the channel receive.

Patch Set 1 #

Patch Set 2 : diff -r 26b078264221 https://code.google.com/p/ogle #

Patch Set 3 : diff -r 26b078264221 https://code.google.com/p/ogle #

Patch Set 4 : diff -r fe71428bbae6 https://code.google.com/p/ogle #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M program/server/ptrace.go View 1 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 3
nigeltao
Hello r@golang.org, I'd like you to review this change to https://code.google.com/p/ogle
10 years ago (2014-04-21 02:14:14 UTC) #1
r
LGTM
10 years ago (2014-04-21 06:41:06 UTC) #2
nigeltao
10 years ago (2014-04-26 15:27:08 UTC) #3
*** Submitted as https://code.google.com/p/ogle/source/detail?r=0418e9debffa ***

ogle/program/server: clarify ordering of evaluation when ptraceRun
wraps a closure that 'returns' more than just an error.

I don't think this changes the actual behavior with the gc compiler,
but a different compiler might not optimize the "return foo" part
as a no-op, in:
func f() (foo int, err error) {
        etc
        return foo, <-s.ec
}
and then it's possibly racy whether foo is evaluated before or after
the channel receive.

LGTM=r
R=r
https://codereview.appspot.com/89750043
Sign in to reply to this message.

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