import (
"runtime/internal/atomic"
"runtime/internal/sys"
+ "unsafe"
)
type suspendGState struct {
// functions (except at calls).
return false
}
- if funcdata(f, _FUNCDATA_LocalsPointerMaps) == nil {
+ if fd := funcdata(f, _FUNCDATA_LocalsPointerMaps); fd == nil || fd == unsafe.Pointer(&no_pointers_stackmap) {
// This is assembly code. Don't assume it's
- // well-formed.
+ // well-formed. We identify assembly code by
+ // checking that it has either no stack map, or
+ // no_pointers_stackmap, which is the stack map
+ // for ones marked as NO_LOCAL_POINTERS.
//
// TODO: Are there cases that are safe but don't have a
// locals pointer map, like empty frame functions?
return true
}
+
+var no_pointers_stackmap uint64 // defined in assembly, for NO_LOCAL_POINTERS macro