From e118ad3273b2fe49028e463aa0306e2cd24cac58 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Fri, 10 Sep 2021 23:43:39 +0200 Subject: [PATCH] wasm: Avoid making StringView of temporary ByteBuffer --- Userland/Utilities/wasm.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Utilities/wasm.cpp b/Userland/Utilities/wasm.cpp index 3229aefb4b..caa153d277 100644 --- a/Userland/Utilities/wasm.cpp +++ b/Userland/Utilities/wasm.cpp @@ -399,7 +399,8 @@ int main(int argc, char* argv[]) first = false; else argument_builder.append(", "sv); - argument_builder.append(StringView(stream.copy_into_contiguous_buffer()).trim_whitespace()); + ByteBuffer buffer = stream.copy_into_contiguous_buffer(); + argument_builder.append(StringView(buffer).trim_whitespace()); } dbgln("[wasm runtime] Stub function {} was called with the following arguments: {}", name, argument_builder.to_string()); Vector result;