niti: fix CString::fast_cstring semantics
authorLucas Bajolet <lucas.bajolet@gmail.com>
Tue, 8 May 2018 16:01:30 +0000 (12:01 -0400)
committerLucas Bajolet <lucas.bajolet@gmail.com>
Thu, 10 May 2018 20:48:30 +0000 (16:48 -0400)
commit4f08e0f132c283652c45ee43f5be66c37041333d
tree6d55c8c923d0b3d182f8396e34a1e4bd5d1f2818
parenta46817d351713e3877ada8c482e83c0d74a60ac5
niti: fix CString::fast_cstring semantics

The old implementation of CString::fast_cstring used to create a new
CString instance instead of sharing the underlying buffer.

This in turn caused code relying on this semantic to fail as the memory
was not re-initialized properly.

This commit fixes this behaviour by introducing a new cstring
constructor specific for the VM and Interpreter.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>
src/interpreter/naive_interpreter.nit