hold destination stack locations by offset
This commit is contained in:
parent
e3e7c53762
commit
0c8ef0bd32
|
@ -12,8 +12,8 @@ extern "C" {
|
||||||
struct pic_jmpbuf {
|
struct pic_jmpbuf {
|
||||||
jmp_buf here;
|
jmp_buf here;
|
||||||
struct pic_proc *handler;
|
struct pic_proc *handler;
|
||||||
pic_callinfo *ci;
|
ptrdiff_t ci_offset;
|
||||||
pic_value *sp;
|
ptrdiff_t sp_offset;
|
||||||
pic_code *ip;
|
pic_code *ip;
|
||||||
jmp_buf *prev_jmp;
|
jmp_buf *prev_jmp;
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,8 +47,8 @@ pic_push_try(pic_state *pic, struct pic_proc *handler)
|
||||||
|
|
||||||
try_jmp->handler = handler;
|
try_jmp->handler = handler;
|
||||||
|
|
||||||
try_jmp->ci = pic->ci;
|
try_jmp->ci_offset = pic->ci - pic->cibase;
|
||||||
try_jmp->sp = pic->sp;
|
try_jmp->sp_offset = pic->sp - pic->stbase;
|
||||||
try_jmp->ip = pic->ip;
|
try_jmp->ip = pic->ip;
|
||||||
|
|
||||||
try_jmp->prev_jmp = pic->jmp;
|
try_jmp->prev_jmp = pic->jmp;
|
||||||
|
@ -64,8 +64,8 @@ pic_pop_try(pic_state *pic)
|
||||||
|
|
||||||
assert(pic->jmp == &try_jmp->here);
|
assert(pic->jmp == &try_jmp->here);
|
||||||
|
|
||||||
pic->ci = try_jmp->ci;
|
pic->ci += try_jmp->ci_offset;
|
||||||
pic->sp = try_jmp->sp;
|
pic->sp += try_jmp->sp_offset;
|
||||||
pic->ip = try_jmp->ip;
|
pic->ip = try_jmp->ip;
|
||||||
|
|
||||||
pic->jmp = try_jmp->prev_jmp;
|
pic->jmp = try_jmp->prev_jmp;
|
||||||
|
|
Loading…
Reference in New Issue