Skip to content

Commit

Permalink
Fix until loop miscompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Oct 23, 2010
1 parent 28fb38b commit 93ff317
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CgOpToCLROp.pm
Expand Up @@ -239,8 +239,8 @@ sub do_ternary {

sub do_while {
my ($op, $check, $body) = @_;
my $once = $op->[1];
my $until = $op->[2];
my $until = $op->[1];
my $once = $op->[2];
die "type error" unless $body->type eq 'Void';

my $lagain = 'again' . ($spill++);
Expand Down
3 changes: 3 additions & 0 deletions test2.pl
Expand Up @@ -33,6 +33,9 @@

my @ar = [1, 2, 3];
is +@ar, 1, "array constructors are singular";
my $i = 0;
$i++ until $i == 10;
is $i, 10, "until loops functional";
}

# {
Expand Down

0 comments on commit 93ff317

Please sign in to comment.