fix bytecode optimizer bug in eliminating let[rec]-values bindings of (values) to zero variables

svn: r7229
This commit is contained in:
Matthew Flatt 2007-08-30 18:52:58 +00:00
parent 0b725ae0f4
commit 32ad0656a6

View File

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