Skip to content

Commit 4a8628d

Browse files
committed
Add extra #check_readable checks in StringIO to pass new test
1 parent 04d3af9 commit 4a8628d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/truffle/stringio.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def each_byte
212212
string = d.string
213213

214214
while d.pos < string.length
215+
check_readable
215216
byte = string.getbyte d.pos
216217
d.pos += 1
217218
yield byte
@@ -239,6 +240,7 @@ def each_codepoint(&block)
239240
string = d.string
240241

241242
while d.pos < string.bytesize
243+
check_readable
242244
char = Primitive.string_chr_at(string, d.pos)
243245

244246
unless char

0 commit comments

Comments
 (0)