mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-03 19:26:36 +02:00
detecting variable uses in the wrong phase (issue #259)
This commit is contained in:
parent
5a770c4909
commit
047f35432b
1 changed files with 7 additions and 2 deletions
5
vm.c
5
vm.c
|
@ -259,10 +259,15 @@ static void generate_ref (sexp ctx, sexp ref, int unboxp) {
|
||||||
sexp_emit_push(ctx, sexp_ref_cell(ref));
|
sexp_emit_push(ctx, sexp_ref_cell(ref));
|
||||||
} else {
|
} else {
|
||||||
lam = sexp_context_lambda(ctx);
|
lam = sexp_context_lambda(ctx);
|
||||||
|
if (!lam || !sexp_lambdap(lam)) {
|
||||||
|
sexp_warn(ctx, "variable out of phase: ", sexp_ref_name(ref));
|
||||||
|
sexp_emit_push(ctx, SEXP_VOID);
|
||||||
|
} else {
|
||||||
generate_non_global_ref(ctx, sexp_ref_name(ref), sexp_ref_cell(ref),
|
generate_non_global_ref(ctx, sexp_ref_name(ref), sexp_ref_cell(ref),
|
||||||
lam, sexp_lambda_fv(lam), unboxp);
|
lam, sexp_lambda_fv(lam), unboxp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void generate_set (sexp ctx, sexp set) {
|
static void generate_set (sexp ctx, sexp set) {
|
||||||
sexp ref = sexp_set_var(set), lambda;
|
sexp ref = sexp_set_var(set), lambda;
|
||||||
|
|
Loading…
Add table
Reference in a new issue