diff options
| author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-13 22:32:32 +0000 |
|---|---|---|
| committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-13 22:32:32 +0000 |
| commit | eae8641f08ed9258b22a456dd9f8dd015ec3c773 (patch) | |
| tree | edb990ae62544f8946086fcb5d2d72dbfffacef9 /libjava/classpath/java | |
| parent | 8e86290125c6b2ffa4c9417729497a3551f7aaae (diff) | |
| download | ppe42-gcc-eae8641f08ed9258b22a456dd9f8dd015ec3c773.tar.gz ppe42-gcc-eae8641f08ed9258b22a456dd9f8dd015ec3c773.zip | |
compiler, runtime: Fix unexpected GC interfering with closure passing.
The Go frontend passes closures through to functions using the
functions __go_set_closure and __go_get_closure. The
expectation is that there are no function calls between
set_closure and get_closure. However, it turns out that there
can be function calls if some of the function arguments
require type conversion to an interface type. Converting to
an interface type can allocate memory, and that can in turn
trigger a garbage collection, and that can in turn call pool
cleanup functions that may call __go_set_closure. So the
called function can see the wrong closure value, which is bad.
This patch fixes the memory allocation function to preserve the
closure value across any possible garbage collection.
A test case is the libgo database/sql check run with the
environment variable GOGC set to 1.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@213933 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java')
0 files changed, 0 insertions, 0 deletions

