increment xlen in the end

This commit is contained in:
Yuichi Nishiwaki 2013-11-26 16:50:38 -08:00
parent c336a354e4
commit b2704fb123
1 changed files with 2 additions and 1 deletions

View File

@ -16,12 +16,13 @@ pic_defmacro(pic_state *pic, const char *name, struct pic_proc *macro)
{ {
int idx; int idx;
idx = pic->xlen++; idx = pic->xlen;
if (idx >= pic->xcapa) { if (idx >= pic->xcapa) {
pic_abort(pic, "macro table overflow"); pic_abort(pic, "macro table overflow");
} }
pic->stx[idx] = pic_syntax_new_macro(pic, pic_intern_cstr(pic, name), macro); pic->stx[idx] = pic_syntax_new_macro(pic, pic_intern_cstr(pic, name), macro);
xh_put(pic->global_tbl, name, ~idx); xh_put(pic->global_tbl, name, ~idx);
pic->xlen++;
} }
static pic_sym static pic_sym