mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 06:50:31 +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:
parent
249bab1c53
commit
196b40932e
1 changed files with 14 additions and 2 deletions
|
@ -284,7 +284,13 @@ VM_DEFINE_INSTRUCTION (25, toplevel_ref, "toplevel-ref", 1, 0, 1)
|
||||||
/* might longjmp */
|
/* might longjmp */
|
||||||
what = scm_module_lookup (mod, what);
|
what = scm_module_lookup (mod, what);
|
||||||
else
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -367,7 +373,13 @@ VM_DEFINE_INSTRUCTION (29, toplevel_set, "toplevel-set", 1, 1, 0)
|
||||||
/* might longjmp */
|
/* might longjmp */
|
||||||
what = scm_module_lookup (mod, what);
|
what = scm_module_lookup (mod, what);
|
||||||
else
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue