diff --git a/moo/lib/comp.c b/moo/lib/comp.c index f8c7524..e72fa92 100644 --- a/moo/lib/comp.c +++ b/moo/lib/comp.c @@ -6683,14 +6683,12 @@ static int compile_goto_statement (moo_t* moo) moo_copy_oochars (nptr, target->ptr, target->len); nptr[target->len] = '\0'; -#if 0 - if (add_to_oow_pool(moo, &cc->mth._goto->target_ip_pool, cc->mth.code.len) <= -1 || - emit_single_param_instruction(moo, BCODE_JUMP_FORWARD_0, MAX_CODE_JUMP, srcloc) <= -1) + _goto->ip = cc->mth.code.len; + if (emit_single_param_instruction(moo, BCODE_JUMP_FORWARD_0, MAX_CODE_JUMP, TOKEN_LOC(moo)) <= -1) { moo_freemem (moo, _goto); return -1; } -#endif _goto->next = cc->mth._goto; cc->mth._goto = _goto; diff --git a/moo/lib/moo-prv.h b/moo/lib/moo-prv.h index f171542..387ce72 100644 --- a/moo/lib/moo-prv.h +++ b/moo/lib/moo-prv.h @@ -403,18 +403,18 @@ struct moo_loop_t typedef struct moo_label_t moo_label_t; struct moo_label_t { - moo_ooch_t* name; moo_oow_t level; moo_label_t* next; + /* ... label name at the back ... */ }; typedef struct moo_goto_t moo_goto_t; struct moo_goto_t { - moo_ooch_t* target_name; moo_oow_t level; moo_oow_t ip; moo_goto_t* next; + /* ... target label name at the back ... */ }; typedef struct moo_oopbuf_t moo_oopbuf_t;