stop warning in macroexpand, and creating a duplicate slot

This commit is contained in:
Yuichi Nishiwaki 2014-02-07 02:14:39 +09:00
parent fd0553ac25
commit c4040949ff
1 changed files with 4 additions and 4 deletions

View File

@ -496,11 +496,11 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
if (! pic_sym_p(var)) { if (! pic_sym_p(var)) {
pic_error(pic, "binding to non-symbol object"); pic_error(pic, "binding to non-symbol object");
} }
uniq = pic_gensym(pic, pic_sym(var)); /* do not make duplicate variable slot*/
if (xh_get_int(senv->tbl, pic_sym(var)) != NULL) { if (xh_get_int(senv->tbl, pic_sym(var)) == NULL) {
pic_warn(pic, "redefining variable"); uniq = pic_gensym(pic, pic_sym(var));
xh_put_int(senv->tbl, pic_sym(var), (int)uniq);
} }
xh_put_int(senv->tbl, pic_sym(var), (int)uniq);
} }
FALLTHROUGH; FALLTHROUGH;
case PIC_STX_SET: case PIC_STX_SET: