From b9ef51530f684feb457137ffcb1efb3051dc46a1 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 8 Jan 2014 20:41:29 +0900 Subject: [PATCH] don't intern symbols newly generated by new_uniq_sym --- src/macro.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/macro.c b/src/macro.c index 41260c6e..56288401 100644 --- a/src/macro.c +++ b/src/macro.c @@ -24,9 +24,15 @@ new_uniq_sym(pic_state *pic, pic_sym base) str = (char *)pic_alloc(pic, strlen(pic_symbol_name(pic, base)) + (int)log10(s) + 3); sprintf(str, "%s@%d", pic_symbol_name(pic, base), s); - uniq = pic_intern_cstr(pic, str); - pic_free(pic, str); + /* don't put the symbol to ic->sym_tbl to keep it uninterned */ + if (pic->slen >= pic->scapa) { + pic->scapa *= 2; + pic->sym_pool = pic_realloc(pic, pic->sym_pool, sizeof(const char *) * pic->scapa); + } + uniq = pic->slen++; + pic->sym_pool[uniq] = str; + return uniq; }