compiler: fixes false-positive invalid ptr detection in -race (#1376)

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Takeshi Yoneda
2023-04-17 16:44:30 -07:00
committed by GitHub
parent 9aca08c5e6
commit 6a4bdd31db

View File

@@ -1075,7 +1075,7 @@ func (si *stackIterator) Next() bool {
si.base = int(si.stack[frame+1] >> 3)
// *function lives in the third field of callFrame struct. This must be
// aligned with the definition of callFrame struct.
si.fn = (*function)(unsafe.Pointer(uintptr(si.stack[frame+2])))
si.fn = *(**function)(unsafe.Pointer(&si.stack[frame+2]))
return si.fn != nil
}