mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 15:40:19 +02:00
better unbound variable errors in the vm
* libguile/vm-i-system.c (variable-ref, toplevel-ref) (long-toplevel-ref): Fixup callers. * libguile/vm-engine.c (vm_error_unbound): Don't use vm-error for unbound vars, use misc-error. Don't include VM: in the string. Take the name directly in finish_args, not as a list.
This commit is contained in:
parent
1f845305c1
commit
d107921794
2 changed files with 8 additions and 6 deletions
|
@ -306,7 +306,7 @@ VM_DEFINE_INSTRUCTION (25, variable_ref, "variable-ref", 0, 1, 1)
|
|||
|
||||
/* Attempt to provide the variable name in the error message. */
|
||||
var_name = scm_module_reverse_lookup (scm_current_module (), x);
|
||||
finish_args = scm_list_1 (scm_is_true (var_name) ? var_name : x);
|
||||
finish_args = scm_is_true (var_name) ? var_name : x;
|
||||
goto vm_error_unbound;
|
||||
}
|
||||
else
|
||||
|
@ -340,7 +340,7 @@ VM_DEFINE_INSTRUCTION (27, toplevel_ref, "toplevel-ref", 1, 0, 1)
|
|||
resolved = resolve_variable (what, scm_program_module (program));
|
||||
if (!VARIABLE_BOUNDP (resolved))
|
||||
{
|
||||
finish_args = scm_list_1 (what);
|
||||
finish_args = what;
|
||||
goto vm_error_unbound;
|
||||
}
|
||||
what = resolved;
|
||||
|
@ -366,7 +366,7 @@ VM_DEFINE_INSTRUCTION (28, long_toplevel_ref, "long-toplevel-ref", 2, 0, 1)
|
|||
resolved = resolve_variable (what, scm_program_module (program));
|
||||
if (!VARIABLE_BOUNDP (resolved))
|
||||
{
|
||||
finish_args = scm_list_1 (what);
|
||||
finish_args = what;
|
||||
goto vm_error_unbound;
|
||||
}
|
||||
what = resolved;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue