mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
Don't try to apply a broken let during simplification.
This commit is contained in:
parent
5ff0aa4397
commit
549257efca
1 changed files with 26 additions and 24 deletions
|
@ -56,6 +56,7 @@ static sexp simplify (sexp ctx, sexp ast, sexp init_substs, sexp lambda) {
|
||||||
ls1 = app;
|
ls1 = app;
|
||||||
ls2 = sexp_cdr(app);
|
ls2 = sexp_cdr(app);
|
||||||
sv = sexp_lambda_sv(sexp_car(app));
|
sv = sexp_lambda_sv(sexp_car(app));
|
||||||
|
if (sexp_length(ctx, p2) == sexp_length(ctx, ls2)) {
|
||||||
for ( ; sexp_pairp(ls2); ls2=sexp_cdr(ls2), p2=sexp_cdr(p2)) {
|
for ( ; sexp_pairp(ls2); ls2=sexp_cdr(ls2), p2=sexp_cdr(p2)) {
|
||||||
if (sexp_not(sexp_memq(ctx, sexp_car(p2), sv))
|
if (sexp_not(sexp_memq(ctx, sexp_car(p2), sv))
|
||||||
&& (! sexp_pointerp(sexp_car(ls2)) || sexp_litp(sexp_car(ls2))
|
&& (! sexp_pointerp(sexp_car(ls2)) || sexp_litp(sexp_car(ls2))
|
||||||
|
@ -83,6 +84,7 @@ static sexp simplify (sexp ctx, sexp ast, sexp init_substs, sexp lambda) {
|
||||||
&& sexp_nullp(sexp_lambda_defs(sexp_car(app))))
|
&& sexp_nullp(sexp_lambda_defs(sexp_car(app))))
|
||||||
app = sexp_lambda_body(sexp_car(app));
|
app = sexp_lambda_body(sexp_car(app));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
res = app;
|
res = app;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue