From 660777406e9f1cedfa0de0059fe43f4f88339368 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 22 Jun 2020 18:33:44 -0700 Subject: [PATCH] Fixed console.log to not use AllocA, in case the input string is very long --- microscript/ILibDuktape_Polyfills.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microscript/ILibDuktape_Polyfills.c b/microscript/ILibDuktape_Polyfills.c index e13fb7f..976d5f4 100644 --- a/microscript/ILibDuktape_Polyfills.c +++ b/microscript/ILibDuktape_Polyfills.c @@ -588,8 +588,8 @@ duk_ret_t ILibDuktape_Polyfills_Console_log(duk_context *ctx) len += 2; // NULL Terminator and final carriage return strLen = len; - str = ILibMemory_AllocateA(strLen + ((PREFIX != NULL) ? strnlen_s(PREFIX, 9) : 0)); - x = (int)(ILibMemory_AllocateA_Size(str) - strLen); + str = Duktape_PushBuffer(ctx, strLen + ((PREFIX != NULL) ? strnlen_s(PREFIX, 9) : 0)); + x = (int)(ILibMemory_Size(str) - strLen); if (x != 0) { strLen += sprintf_s(str, strLen, PREFIX);