diff --git a/cmd/xgo/version.go b/cmd/xgo/version.go index efbab470..2094c7d4 100644 --- a/cmd/xgo/version.go +++ b/cmd/xgo/version.go @@ -3,8 +3,8 @@ package main import "fmt" const VERSION = "1.0.15" -const REVISION = "ee229bd12d0d0fdb24f26602651b01dbd76c7cf1+1" -const NUMBER = 150 +const REVISION = "05e21215595deccfc08d49cb2d502e0d48b3cf4b+1" +const NUMBER = 151 func getRevision() string { return fmt.Sprintf("%s %s BUILD_%d", VERSION, REVISION, NUMBER) diff --git a/runtime/core/version.go b/runtime/core/version.go index 2eaa7956..b4139837 100644 --- a/runtime/core/version.go +++ b/runtime/core/version.go @@ -7,8 +7,8 @@ import ( ) const VERSION = "1.0.15" -const REVISION = "ee229bd12d0d0fdb24f26602651b01dbd76c7cf1+1" -const NUMBER = 150 +const REVISION = "05e21215595deccfc08d49cb2d502e0d48b3cf4b+1" +const NUMBER = 151 // these fields will be filled by compiler const XGO_VERSION = "" diff --git a/runtime/trap_runtime/xgo_trap.go b/runtime/trap_runtime/xgo_trap.go index 826e2871..92a956d0 100644 --- a/runtime/trap_runtime/xgo_trap.go +++ b/runtime/trap_runtime/xgo_trap.go @@ -21,6 +21,11 @@ func __xgo_trap(pkgPath string, identityName string, generic bool, recv interfac if __xgo_trap_impl == nil { return nil, false } + gp := getg() + if gp.m.curg != gp { + // go code on the system stack can't defer + return nil, false + } pc := getcallerpc() fn := findfunc(pc) // TODO: what about inlined func? @@ -32,6 +37,12 @@ func __xgo_trap_for_generated(pkgPath string, pc uintptr, identityName string, g if __xgo_trap_impl == nil { return nil, false } + gp := getg() + if gp.m.curg != gp { + // go code on the system stack can't defer + return nil, false + } + fn := findfunc(pc) // TODO: what about inlined func? // funcName := fn.datap.funcName(fn.nameOff) // not necessary,because it is unsafe