hold destination stack locations by offset

This commit is contained in:
Yuichi Nishiwaki 2014-07-15 17:47:17 +09:00
parent e3e7c53762
commit 0c8ef0bd32
2 changed files with 6 additions and 6 deletions

View File

@ -12,8 +12,8 @@ extern "C" {
struct pic_jmpbuf {
jmp_buf here;
struct pic_proc *handler;
pic_callinfo *ci;
pic_value *sp;
ptrdiff_t ci_offset;
ptrdiff_t sp_offset;
pic_code *ip;
jmp_buf *prev_jmp;
};

View File

@ -47,8 +47,8 @@ pic_push_try(pic_state *pic, struct pic_proc *handler)
try_jmp->handler = handler;
try_jmp->ci = pic->ci;
try_jmp->sp = pic->sp;
try_jmp->ci_offset = pic->ci - pic->cibase;
try_jmp->sp_offset = pic->sp - pic->stbase;
try_jmp->ip = pic->ip;
try_jmp->prev_jmp = pic->jmp;
@ -64,8 +64,8 @@ pic_pop_try(pic_state *pic)
assert(pic->jmp == &try_jmp->here);
pic->ci = try_jmp->ci;
pic->sp = try_jmp->sp;
pic->ci += try_jmp->ci_offset;
pic->sp += try_jmp->sp_offset;
pic->ip = try_jmp->ip;
pic->jmp = try_jmp->prev_jmp;