Error handling on failing set!.

* mes.c (set_env_x): Produce error message [WAS: dump core].
This commit is contained in:
Jan Nieuwenhuizen 2016-10-30 15:38:27 +01:00
parent 3b4e9f36c8
commit 2cad00527e
1 changed files with 9 additions and 1 deletions

10
mes.c
View File

@ -194,7 +194,15 @@ scm *
set_env_x (scm *x, scm *e, scm *a)
{
cache_invalidate (x);
return set_cdr_x (assq (x, a), e);
scm *p = assq (x, a);
if (p->type != PAIR)
{
fprintf (stderr, "set!: unbound variable:");
display_ (stderr, x);
fprintf (stderr, "\n");
assert (!"unbound variable");
}
return set_cdr_x (p, e);
}
scm *