Macro-generating macro may rename symbol that will be used as a newly

introduced identifier
This commit is contained in:
Yuichi Nishiwaki 2014-07-16 14:46:30 +09:00
parent 8e114fae6b
commit 6ee4d49a96
1 changed files with 6 additions and 4 deletions

View File

@ -34,7 +34,12 @@ pic_find_rename(pic_state *pic, struct pic_senv *senv, pic_sym sym, pic_sym *ren
{
xh_entry *e;
UNUSED(pic);
if (! pic_interned_p(pic, sym)) {
if (rename != NULL) {
*rename = sym;
}
return true;
}
if ((e = xh_get_int(&senv->renames, sym)) == NULL) {
return false;
@ -73,9 +78,6 @@ translate(pic_state *pic, pic_sym sym, struct pic_senv *senv, struct pic_dict *c
{
pic_sym rename;
if (! pic_interned_p(pic, sym)) {
return sym;
}
while (true) {
if (pic_find_rename(pic, senv, sym, &rename)) {
return rename;