Skip to content

Commit 97caf12

Browse files
author
Atul Katti
committed
[1.10>master] [MERGE #5554 @atulkatti] MSFT:18321215 Unroot the temporary guest arena created by parser before releasing it to the ThreadContext.
Merge pull request #5554 from atulkatti:Bug18321215.UnrootParserGuestArena.1
2 parents 0728265 + 80b8dde commit 97caf12

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

lib/Parser/Parse.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13995,6 +13995,7 @@ void Parser::ReleaseTemporaryGuestArena()
1399513995
if (this->m_scriptContext != nullptr)
1399613996
{
1399713997
this->m_scriptContext->ReleaseTemporaryGuestAllocator(m_tempGuestArena);
13998+
m_tempGuestArena.Unroot();
1399813999
}
1399914000

1400014001
m_tempGuestArenaReleased = true;

lib/Runtime/Base/ScriptContext.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,16 +2034,10 @@ namespace Js
20342034
ArenaAllocator * allocator = nullptr;
20352035

20362036
#define ACQUIRE_TEMP_GUEST_ALLOCATOR(allocator, scriptContext, name) \
2037-
TryFinally([&]() \
2038-
{ \
2039-
tempGuest##allocator = scriptContext->GetTemporaryGuestAllocator(name); \
2040-
allocator = tempGuest##allocator->GetAllocator();
2037+
tempGuest##allocator = scriptContext->GetTemporaryGuestAllocator(name); \
2038+
allocator = tempGuest##allocator->GetAllocator();
20412039

20422040
#define RELEASE_TEMP_GUEST_ALLOCATOR(allocator, scriptContext) \
2043-
}, \
2044-
[&](bool /*hasException*/) \
2045-
{ \
2046-
if (tempGuest##allocator) \
2047-
scriptContext->ReleaseTemporaryGuestAllocator(tempGuest##allocator); \
2048-
});
2041+
if (tempGuest##allocator) \
2042+
scriptContext->ReleaseTemporaryGuestAllocator(tempGuest##allocator);
20492043

test/Array/rlexe.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@
646646
<files>memset_invariant.js</files>
647647
<tags>Slow</tags>
648648
<compile-flags>-mic:1 -off:simplejit -mmoc:0 -off:JITLoopBody</compile-flags>
649+
<timeout>300</timeout>
649650
</default>
650651
</test>
651652
<!--

0 commit comments

Comments
 (0)