mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
FFI: Don't load PC from non-function object in FFI continuation.
Reported by Yichun Zhang. #743
This commit is contained in:
parent
98b7d9a3b2
commit
003f68565d
@ -562,12 +562,12 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| cmp CARG1, #1
|
| cmp CARG1, #1
|
||||||
|.endif
|
|.endif
|
||||||
| ldr PC, [CARG4, #-24] // Restore PC from [cont|PC].
|
| ldr PC, [CARG4, #-24] // Restore PC from [cont|PC].
|
||||||
| ldr CARG3, LFUNC:CARG3->pc
|
|
||||||
| add TMP0, RA, RC
|
| add TMP0, RA, RC
|
||||||
| str TISNIL, [TMP0, #-8] // Ensure one valid arg.
|
| str TISNIL, [TMP0, #-8] // Ensure one valid arg.
|
||||||
|.if FFI
|
|.if FFI
|
||||||
| bls >1
|
| bls >1
|
||||||
|.endif
|
|.endif
|
||||||
|
| ldr CARG3, LFUNC:CARG3->pc
|
||||||
| ldr KBASE, [CARG3, #PC2PROTO(k)]
|
| ldr KBASE, [CARG3, #PC2PROTO(k)]
|
||||||
| // BASE = base, RA = resultptr, CARG4 = meta base
|
| // BASE = base, RA = resultptr, CARG4 = meta base
|
||||||
| br CARG1
|
| br CARG1
|
||||||
|
@ -728,11 +728,11 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| ld PC, -24(RB) // Restore PC from [cont|PC].
|
| ld PC, -24(RB) // Restore PC from [cont|PC].
|
||||||
| cleartp LFUNC:TMP1
|
| cleartp LFUNC:TMP1
|
||||||
| daddu TMP2, RA, RD
|
| daddu TMP2, RA, RD
|
||||||
| ld TMP1, LFUNC:TMP1->pc
|
|
||||||
|.if FFI
|
|.if FFI
|
||||||
| bnez AT, >1
|
| bnez AT, >1
|
||||||
|.endif
|
|.endif
|
||||||
|. sd TISNIL, -8(TMP2) // Ensure one valid arg.
|
|. sd TISNIL, -8(TMP2) // Ensure one valid arg.
|
||||||
|
| ld TMP1, LFUNC:TMP1->pc
|
||||||
| // BASE = base, RA = resultptr, RB = meta base
|
| // BASE = base, RA = resultptr, RB = meta base
|
||||||
| jr TMP0 // Jump to continuation.
|
| jr TMP0 // Jump to continuation.
|
||||||
|. ld KBASE, PC2PROTO(k)(TMP1)
|
|. ld KBASE, PC2PROTO(k)(TMP1)
|
||||||
|
Loading…
Reference in New Issue
Block a user