From 1afd45e895ca54eb95d5b6b9cf8408fe2a7074c4 Mon Sep 17 00:00:00 2001 From: Timo Paulssen Date: Wed, 15 Nov 2017 03:18:13 +0100 Subject: [PATCH] create in situ for nqp::chr if it fits into 8bit. --- src/strings/ops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/strings/ops.c b/src/strings/ops.c index 7b490e5ad4..ae79077d04 100644 --- a/src/strings/ops.c +++ b/src/strings/ops.c @@ -2555,9 +2555,8 @@ MVMString * MVM_string_chr(MVMThreadContext *tc, MVMint64 cp) { s = (MVMString *)REPR(tc->instance->VMString)->allocate(tc, STABLE(tc->instance->VMString)); if (can_fit_into_8bit(g)) { - s->body.storage_type = MVM_STRING_GRAPHEME_8; - s->body.storage.blob_8 = MVM_malloc(sizeof(MVMGrapheme8)); - s->body.storage.blob_8[0] = g; + s->body.storage_type = MVM_STRING_IN_SITU; + s->body.storage.in_situ[0] = g; } else { s->body.storage_type = MVM_STRING_GRAPHEME_32; s->body.storage.blob_32 = MVM_malloc(sizeof(MVMGrapheme32));