add error guard

This commit is contained in:
Yuichi Nishiwaki 2013-11-27 15:57:23 +09:00
parent bedc5dc6be
commit 9a027dae6e
1 changed files with 3 additions and 0 deletions

View File

@ -248,6 +248,9 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
return v;
}
if (! pic_symbol_p(var)) {
pic_error(pic, "binding to non-symbol object");
}
uniq = new_uniq_sym(pic, pic_sym(var));
xh_put(senv->tbl, pic_symbol_name(pic, pic_sym(var)), (int)uniq);
}