Skip to content

Commit

Permalink
skip mock on system stack
Browse files Browse the repository at this point in the history
  • Loading branch information
xhd2015 committed Apr 2, 2024
1 parent 05e2121 commit 2861a46
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/xgo/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions runtime/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
11 changes: 11 additions & 0 deletions runtime/trap_runtime/xgo_trap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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
Expand Down

0 comments on commit 2861a46

Please sign in to comment.