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