From 32ad0656a686680f5c8f3796046c405b9c2aa000 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 30 Aug 2007 18:52:58 +0000 Subject: [PATCH] fix bytecode optimizer bug in eliminating let[rec]-values bindings of (values) to zero variables svn: r7229 --- src/mzscheme/src/syntax.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mzscheme/src/syntax.c b/src/mzscheme/src/syntax.c index 4ddbe5e62f..549bce2e4e 100644 --- a/src/mzscheme/src/syntax.c +++ b/src/mzscheme/src/syntax.c @@ -2770,7 +2770,7 @@ scheme_optimize_lets(Scheme_Object *form, Optimize_Info *info, int for_inline) if ((pre_body->count != 1) && is_values_apply(value) && scheme_omittable_expr(value, pre_body->count)) { - if (!pre_body->count && !i && (head->num_clauses > 1)) { + if (!pre_body->count && !i) { /* We want to drop the clause entirely, but doing it here messes up the loop for letrec. So wait and remove it at the end. */ @@ -2947,7 +2947,10 @@ scheme_optimize_lets(Scheme_Object *form, Optimize_Info *info, int for_inline) } body = scheme_optimize_expr(body, body_info); - pre_body->body = body; + if (head->num_clauses) + pre_body->body = body; + else + head->body = body; info->size += 1; info->single_result = body_info->single_result;