Status: New
Owner: ----

New issue 1579 by [email protected]: d8 readline() breaks lines
http://code.google.com/p/v8/issues/detail?id=1579

Opening d8 and sending it data through stdin, which it reads through readline(), leads to incorrect results: Lines are broken before they should be. For example, if test.js is this

  for (var i = 0; i < 3; i++)
    print(i + '|' + readline());

and we run this in python

  print subprocess.Popen([PATH_TO_D8, 'test.js'],
stdin=subprocess.PIPE).communicate('%struct.opj_cparameters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32*, i8*, i32, i32, [32 x %struct.opj_poc], i32, i32, [100 x float], [100 x float], i32, i32, i32, i32, i32, i32, i32, i32, [33 x i32], [33 x i32], [4096 x i8], [4096 x i8], i32, [4096 x i8], i32, i32, i32, i32, i32, i32, i32, i32, [16 x i32], [16 x i32], [16 x i32], [16 x i32], [16 x i32], i32, i32, i32, i32, [16 x i32], [16 x i32], i32, i32, i32, i8, i8, i8 }')

then the output is

0|%struct.opj_cparameters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32*, i8*, i32, i32, [32 x %struct.opj_poc], i32, i32, [100 x float], [100 x float], i32, i32, i32, i32, i32, i32, i32, i32, [33 x i32], [33 x i32], [4096 x i8], [4096 x i8], i32, [ 1|096 x i8], i32, i32, i32, i32, i32, i32, i32, i32, [16 x i32], [16 x i32], [16 x i32], [16 x i32], [16 x i32], i32, i32, i32, i32, [16 x i32], [16 x i32], i32, i32, i32, i8, i8, i8
  2|null

as if \n's were added where they did not exist. The correct output should have a single long line with beginning with 0|, and then 1|null, 2|null. SpiderMonkey gives the correct output.

This is a regression from sometime during the last few months.


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to