Commit c4206cb2 authored by Alexey Borzenkov's avatar Alexey Borzenkov Committed by Russ Cox

runtime: save cdecl registers in Windows SEH handler

Fixes #1779

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4566041
parent 463f478d
...@@ -59,15 +59,21 @@ TEXT runtime·setlasterror(SB),7,$0 ...@@ -59,15 +59,21 @@ TEXT runtime·setlasterror(SB),7,$0
TEXT runtime·sigtramp(SB),7,$0 TEXT runtime·sigtramp(SB),7,$0
PUSHL BP // cdecl PUSHL BP // cdecl
PUSHL BX
PUSHL SI
PUSHL DI
PUSHL 0(FS) PUSHL 0(FS)
CALL runtime·sigtramp1(SB) CALL runtime·sigtramp1(SB)
POPL 0(FS) POPL 0(FS)
POPL DI
POPL SI
POPL BX
POPL BP POPL BP
RET RET
TEXT runtime·sigtramp1(SB),0,$16-28 TEXT runtime·sigtramp1(SB),0,$16-40
// unwinding? // unwinding?
MOVL info+12(FP), BX MOVL info+24(FP), BX
MOVL 4(BX), CX // exception flags MOVL 4(BX), CX // exception flags
ANDL $6, CX ANDL $6, CX
MOVL $1, AX MOVL $1, AX
...@@ -75,15 +81,15 @@ TEXT runtime·sigtramp1(SB),0,$16-28 ...@@ -75,15 +81,15 @@ TEXT runtime·sigtramp1(SB),0,$16-28
// place ourselves at the top of the SEH chain to // place ourselves at the top of the SEH chain to
// ensure SEH frames lie within thread stack bounds // ensure SEH frames lie within thread stack bounds
MOVL frame+16(FP), CX // our SEH frame MOVL frame+28(FP), CX // our SEH frame
MOVL CX, 0(FS) MOVL CX, 0(FS)
// copy arguments for call to sighandler // copy arguments for call to sighandler
MOVL BX, 0(SP) MOVL BX, 0(SP)
MOVL CX, 4(SP) MOVL CX, 4(SP)
MOVL context+20(FP), BX MOVL context+32(FP), BX
MOVL BX, 8(SP) MOVL BX, 8(SP)
MOVL dispatcher+24(FP), BX MOVL dispatcher+36(FP), BX
MOVL BX, 12(SP) MOVL BX, 12(SP)
CALL runtime·sighandler(SB) CALL runtime·sighandler(SB)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment