Commit 77354c39 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: reset typed dangling pointer

If for whatever reason seh points into Go heap region,
the dangling pointer will cause memory corruption during GC.
Update #5193.

R=golang-dev, alex.brainman, iant
CC=golang-dev
https://golang.org/cl/8402045
parent 44c4a0d1
...@@ -695,6 +695,7 @@ runtime·dropm(void) ...@@ -695,6 +695,7 @@ runtime·dropm(void)
// Undo whatever initialization minit did during needm. // Undo whatever initialization minit did during needm.
runtime·unminit(); runtime·unminit();
m->seh = nil; // reset dangling typed pointer
// Clear m and g, and return m to the extra list. // Clear m and g, and return m to the extra list.
// After the call to setmg we can only call nosplit functions. // After the call to setmg we can only call nosplit functions.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment