diff options
Diffstat (limited to 'src/routines')
| -rw-r--r-- | src/routines/break.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/routines/break.c b/src/routines/break.c index 3ee94a1..bf13ca6 100644 --- a/src/routines/break.c +++ b/src/routines/break.c @@ -40,7 +40,7 @@ static enum nw_state skip(struct nw_interp *const i) i->exception = exc; #ifdef NW_LOG - nwp_log("%s from offset: %ld\n", exc, b->pc); + nwp_log("%s, offset: %#lx\n", exc, b->pc); #endif return NW_FATAL; } @@ -66,7 +66,7 @@ static enum nw_state get_dst(struct nw_interp *const i) if (n) return n; - else if (pc == b->pc) + else if (pc == b->pc && b->toffset_i++ >= b->table_offset) i->next = seek_dst; else return skip(i); @@ -232,12 +232,14 @@ static enum nw_state tell(struct nw_interp *const i) return NW_AGAIN; } -void nwp_break(struct nw_interp *const i, const nw_varuint32 relative_depth) +void nwp_break(struct nw_interp *const i, const nw_varuint32 relative_depth, + const nw_varuint32 table_offset) { const struct nw_i_sm_break b = {0}; struct nw_i_sm_break *const pb = &i->sm.brk; *pb = b; pb->relative_depth = relative_depth; + pb->table_offset = table_offset; i->next = tell; } |
