Skip to content

Commit 766ea1b

Browse files
committed
address comments.
Signed-off-by: doujiang24 <[email protected]>
1 parent 8dc86e0 commit 766ea1b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/runtime/cgo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func cgoKeepAlive(any) { throw("cgoKeepAlive should not be called") }
8181

8282
// cgoAlwaysFalse is a boolean value that is always false.
8383
// The cgo-generated code says if cgoAlwaysFalse { cgoUse(p) },
84-
// or if cgoAlwaysFalse { cgoUse(p) }.
84+
// or if cgoAlwaysFalse { cgoKeepAlive(p) }.
8585
// The compiler cannot see that cgoAlwaysFalse is always false,
8686
// so it emits the test and keeps the call, giving the desired
8787
// escape/alive analysis result. The test is cheaper than the call.

src/runtime/crash_cgo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ func TestCgoEscapeWithMultiplePointers(t *testing.T) {
774774
got := runTestProg(t, "testprogcgo", "CgoEscapeWithMultiplePointers")
775775
want := "OK\n"
776776
if got != want {
777-
t.Fatalf("want %s, got %s\n", want, got)
777+
t.Fatalf("output is %s; want %s", got, want)
778778
}
779779
}
780780

0 commit comments

Comments
 (0)