store rlabels in global state

This commit is contained in:
Yuichi Nishiwaki 2014-06-25 15:37:24 +09:00
parent 219b244743
commit 0b087b785e
2 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,8 @@ typedef struct {
pic_value lib_tbl;
struct pic_lib *lib;
xhash rlabels;
jmp_buf *jmp;
struct pic_error *err;
struct pic_jmpbuf *try_jmps;

View File

@ -64,6 +64,9 @@ pic_open(int argc, char *argv[], char **envp)
pic->lib_tbl = pic_nil_value();
pic->lib = NULL;
/* reader */
xh_init_int(&pic->rlabels, sizeof(pic_value));
/* error handling */
pic->jmp = NULL;
pic->err = NULL;
@ -154,6 +157,7 @@ pic_close(pic_state *pic)
xh_destroy(&pic->syms);
xh_destroy(&pic->global_tbl);
xh_destroy(&pic->macros);
xh_destroy(&pic->rlabels);
/* free GC arena */
free(pic->arena);