Skip to content

Commit 98ef1a1

Browse files
committed
Compilation of literal nodes ignored negate flag; fix this.
1 parent a6a4c80 commit 98ef1a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/QAST/Compiler.nqp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,11 @@ class QAST::Compiler is HLL::Compiler {
250250
my $litconst := $node[0];
251251
my $litlen := nqp::chars($litconst);
252252
my $litpost := self.escape($litconst);
253+
my $cmpop := $node.negate ?? 'eq' !! 'ne';
253254
$ops.push_pirop('add', '$I11', %*REG<pos>, $litlen);
254255
$ops.push_pirop('gt', '$I11', %*REG<eos>, %*REG<fail>);
255256
$ops.push_pirop('substr', '$S10', %*REG<tgt>, %*REG<pos>, $litlen);
256-
$ops.push_pirop('ne', '$S10', $litpost, %*REG<fail>);
257+
$ops.push_pirop($cmpop, '$S10', $litpost, %*REG<fail>);
257258
$ops.push_pirop('add', %*REG<pos>, $litlen);
258259
$ops;
259260
}

0 commit comments

Comments
 (0)