Skip to content

Commit 80b8dde

Browse files
author
Atul Katti
committed
[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 0625d4a + c445c7c commit 80b8dde

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
@@ -13904,6 +13904,7 @@ void Parser::ReleaseTemporaryGuestArena()
1390413904
if (this->m_scriptContext != nullptr)
1390513905
{
1390613906
this->m_scriptContext->ReleaseTemporaryGuestAllocator(m_tempGuestArena);
13907+
m_tempGuestArena.Unroot();
1390713908
}
1390813909

1390913910
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)