1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-29 22:40:34 +02:00

fix handling of pre-modules errors in the vm

* libguile/vm-i-system.c (toplevel-ref, toplevel-set): Correct situation
  whereby we would not throw when toplevel vars were unbound, before
  modules had booted.
This commit is contained in:
Andy Wingo 2009-03-09 20:32:05 +01:00
parent 249bab1c53
commit 196b40932e

View file

@ -284,7 +284,13 @@ VM_DEFINE_INSTRUCTION (25, toplevel_ref, "toplevel-ref", 1, 0, 1)
/* might longjmp */
what = scm_module_lookup (mod, what);
else
what = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
{
SCM v = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
if (scm_is_false (v))
SCM_MISC_ERROR ("unbound variable: ~S", scm_list_1 (what));
else
what = v;
}
}
else
{
@ -367,7 +373,13 @@ VM_DEFINE_INSTRUCTION (29, toplevel_set, "toplevel-set", 1, 1, 0)
/* might longjmp */
what = scm_module_lookup (mod, what);
else
what = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
{
SCM v = scm_sym2var (what, SCM_BOOL_F, SCM_BOOL_F);
if (scm_is_false (v))
SCM_MISC_ERROR ("unbound variable: ~S", scm_list_1 (what));
else
what = v;
}
}
else
{