]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.5] cmd/compile: fix uninitialized memory in compare of interface...
authorAustin Clements <austin@google.com>
Mon, 24 Aug 2015 17:35:49 +0000 (13:35 -0400)
committerAndrew Gerrand <adg@golang.org>
Tue, 8 Sep 2015 06:04:05 +0000 (06:04 +0000)
commite4e59921f1cc11e60f0096bcb4d54dd683270821
tree512bfe17c3ffe4dbfdeee68700b408cd4dfb58bc
parent13d03fae63d2b357fa1ebd5c926d699b976cc718
[release-branch.go1.5] cmd/compile: fix uninitialized memory in compare of interface value

A comparison of the form l == r where l is an interface and r is
concrete performs a type assertion on l to convert it to r's type.
However, the compiler fails to zero the temporary where the result of
the type assertion is written, so if the type is a pointer type and a
stack scan occurs while in the type assertion, it may see an invalid
pointer on the stack.

Fix this by zeroing the temporary. This is equivalent to the fix for
type switches from c4092ac.

Fixes #12253.

Change-Id: Iaf205d456b856c056b317b4e888ce892f0c555b9
Reviewed-on: https://go-review.googlesource.com/13872
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-on: https://go-review.googlesource.com/14242
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/compile/internal/gc/walk.go
src/runtime/export_test.go
src/runtime/gc_test.go
src/runtime/iface.go