fix memory issue in the repl

This commit is contained in:
Folkert 2021-04-14 17:42:08 +02:00
parent 870adb20a8
commit 5942f64b3c
2 changed files with 6 additions and 1 deletions

View file

@ -5342,7 +5342,7 @@ fn define_global_str_literal<'a, 'ctx, 'env>(
Some(current) => current,
None => {
let size = message.len() + env.ptr_bytes as usize;
let size = message.bytes().len() + env.ptr_bytes as usize;
let mut bytes = Vec::with_capacity_in(size, env.arena);
// insert NULL bytes for the refcount