mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
Import unbound variable reports in the VM.
* libguile/vm-engine.c (VM_NAME)[vm_error_unbound]: Add comment. * libguile/vm-i-system.c (variable_ref): Attempt provide the name of X in FINISH_ARGS.
This commit is contained in:
parent
fefd60ba4b
commit
1af772303b
2 changed files with 8 additions and 3 deletions
|
@ -307,10 +307,13 @@ VM_DEFINE_INSTRUCTION (26, variable_ref, "variable-ref", 0, 1, 1)
|
|||
{
|
||||
SCM x = *sp;
|
||||
|
||||
if (!VARIABLE_BOUNDP (x))
|
||||
if (SCM_UNLIKELY (!VARIABLE_BOUNDP (x)))
|
||||
{
|
||||
finish_args = scm_list_1 (x);
|
||||
/* Was: finish_args = SCM_LIST1 (SCM_CAR (x)); */
|
||||
SCM var_name;
|
||||
|
||||
/* 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);
|
||||
goto vm_error_unbound;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue