Don't try to apply a broken let during simplification.

This commit is contained in:
Alex Shinn 2011-10-17 08:27:21 +09:00
parent 5ff0aa4397
commit 549257efca

View file

@ -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;