Skip to content

Commit df955c4

Browse files
author
Atul Katti
committed
MSFT:18321215 Unroot the temporary guest arena created by parser before releasing it to the ThreadContext.
1 parent 594381a commit df955c4

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-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

0 commit comments

Comments
 (0)