Skip to content

Commit 31bc846

Browse files
committed
read a byte and not a char in EOF check
Reading a char can fail when this char gets decoded to utf8.
1 parent e4385a2 commit 31bc846

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/vm/parrot/QAST/Operations.nqp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,9 +1846,11 @@ QAST::Operations.add_core_op('eoffh', -> $qastcomp, $op {
18461846
$qastcomp.as_post(
18471847
QAST::Op.new( :op('if'),
18481848
QAST::Op.new( :op('istrue'),
1849-
QAST::Op.new( :op('callmethod'), :name('read'),
1850-
$op[0], QAST::IVal.new( :value(1) )
1851-
)
1849+
QAST::Op.new( :op('elems'),
1850+
QAST::Op.new( :op('callmethod'), :name('read_bytes'),
1851+
$op[0], QAST::IVal.new( :value(1) )
1852+
)
1853+
),
18521854
),
18531855
QAST::Stmts.new(
18541856
QAST::Op.new( :op('callmethod'), :name('seek'),

0 commit comments

Comments
 (0)