Skip to content

Commit

Permalink
feat: not use rbp when callling C func
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Sep 14, 2023
1 parent 502d34c commit 4beeb40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/decoder/assembler_regabi_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ func (self *_Assembler) call_go(fn obj.Addr) {
}

func (self *_Assembler) callc(fn obj.Addr) {
self.Emit("XCHGQ", _IP, _BP)
self.save(_IP)
self.call(fn)
self.Emit("XCHGQ", _IP, _BP)
self.load(_IP)
}

func (self *_Assembler) call_c(fn obj.Addr) {
Expand Down
4 changes: 2 additions & 2 deletions internal/decoder/generic_regabi_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ func (self *_ValueDecoder) call_go(fn obj.Addr) {
}

func (self *_ValueDecoder) callc(fn obj.Addr) {
self.Emit("XCHGQ", _IP, _BP)
self.save(_IP)
self.call(fn)
self.Emit("XCHGQ", _IP, _BP)
self.load(_IP)
}

func (self *_ValueDecoder) call_c(fn obj.Addr) {
Expand Down

0 comments on commit 4beeb40

Please sign in to comment.