mruby/mruby — pull request #460 by tsahara-iij (2012-09-10 10:21:35+00:00)
Title: compiler may generate broken binary if string literal has NUL characters

This bug prevents us from putting a string literal with a NUL character into test suites.

To reproduce the problem, place a line on one of test scripts and run test:

% vi test/t/array.rb
xxx = "qqq\0ppp" (<- insert this at the top of a file)

% head -6 test/t/array.rb
xxx = "qqq\0ppp"
##
# Array ISO Test

assert('Array', '15.2.12') do
Array.class == Class
...

% make test
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all'.
./mrbtest
mrbtest - Embeddable Ruby Test

This is a very early version, please test and report errors.
Thanks :)

make[1]: *** [all] Segmentation fault
make: *** [test] Error 2

% uname -a
Linux localhost. 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux