Skip to content

Commit

Permalink
bc reversed the array index and value
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Mikonos <Michael.Mikonos@tpgtelecom.com.au>
  • Loading branch information
briandfoy and Michael Mikonos committed Feb 12, 2023
1 parent 38be0ba commit 35d0a7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/bc
Expand Up @@ -1722,7 +1722,10 @@ $count++;

} elsif($_ eq 'P') {

push(@ope_stack, $instr->[1].'[]'.(pop(@ope_stack)));
my $value = pop @ope_stack;
my $index = pop @ope_stack;
push @ope_stack, $value;
push @ope_stack, $instr->[1] . '[]' . $index;
next INSTR;

} elsif($_ eq 'v') {
Expand Down

0 comments on commit 35d0a7c

Please sign in to comment.