From 5e8c467c221c3e8dc879b65633ede6def92a945b Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Wed, 14 Feb 2018 15:21:05 -0800 Subject: [PATCH 1/2] fix assert in JIT data serialization --- lib/Runtime/Base/FunctionBody.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Runtime/Base/FunctionBody.h b/lib/Runtime/Base/FunctionBody.h index b7056eb9992..a2953346c5d 100644 --- a/lib/Runtime/Base/FunctionBody.h +++ b/lib/Runtime/Base/FunctionBody.h @@ -437,7 +437,11 @@ namespace Js public: void SetSerializedRpcData(const unsigned char* data, size_t size) { - Assert(serializedRpcData == nullptr); + if (this->serializedRpcData != nullptr) + { + // We may have multiple codegens happen for same entrypoint + HeapDeleteArray(this->serializedRpcDataSize, this->serializedRpcData); + } serializedRpcData = data; serializedRpcDataSize = size; } From e1049e53361fcf7429ed51c8234cf71f451223c6 Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Wed, 14 Feb 2018 17:11:01 -0800 Subject: [PATCH 2/2] resolve issue with SWB --- lib/Runtime/Base/FunctionBody.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Runtime/Base/FunctionBody.h b/lib/Runtime/Base/FunctionBody.h index a2953346c5d..ce5cea2568f 100644 --- a/lib/Runtime/Base/FunctionBody.h +++ b/lib/Runtime/Base/FunctionBody.h @@ -440,7 +440,8 @@ namespace Js if (this->serializedRpcData != nullptr) { // We may have multiple codegens happen for same entrypoint - HeapDeleteArray(this->serializedRpcDataSize, this->serializedRpcData); + const unsigned char* rpcData = this->serializedRpcData; + HeapDeleteArray(this->serializedRpcDataSize, rpcData); } serializedRpcData = data; serializedRpcDataSize = size;