Skip to content

Commit

Permalink
[1.10>master] [MERGE #5554 @atulkatti] MSFT:18321215 Unroot the tempo…
Browse files Browse the repository at this point in the history
…rary guest arena created by parser before releasing it to the ThreadContext.

Merge pull request #5554 from atulkatti:Bug18321215.UnrootParserGuestArena.1
  • Loading branch information
Atul Katti committed Jul 31, 2018
2 parents 0728265 + 80b8dde commit 97caf12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions lib/Parser/Parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13995,6 +13995,7 @@ void Parser::ReleaseTemporaryGuestArena()
if (this->m_scriptContext != nullptr)
{
this->m_scriptContext->ReleaseTemporaryGuestAllocator(m_tempGuestArena);
m_tempGuestArena.Unroot();
}

m_tempGuestArenaReleased = true;
Expand Down
14 changes: 4 additions & 10 deletions lib/Runtime/Base/ScriptContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -2034,16 +2034,10 @@ namespace Js
ArenaAllocator * allocator = nullptr;

#define ACQUIRE_TEMP_GUEST_ALLOCATOR(allocator, scriptContext, name) \
TryFinally([&]() \
{ \
tempGuest##allocator = scriptContext->GetTemporaryGuestAllocator(name); \
allocator = tempGuest##allocator->GetAllocator();
tempGuest##allocator = scriptContext->GetTemporaryGuestAllocator(name); \
allocator = tempGuest##allocator->GetAllocator();

#define RELEASE_TEMP_GUEST_ALLOCATOR(allocator, scriptContext) \
}, \
[&](bool /*hasException*/) \
{ \
if (tempGuest##allocator) \
scriptContext->ReleaseTemporaryGuestAllocator(tempGuest##allocator); \
});
if (tempGuest##allocator) \
scriptContext->ReleaseTemporaryGuestAllocator(tempGuest##allocator);

1 change: 1 addition & 0 deletions test/Array/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@
<files>memset_invariant.js</files>
<tags>Slow</tags>
<compile-flags>-mic:1 -off:simplejit -mmoc:0 -off:JITLoopBody</compile-flags>
<timeout>300</timeout>
</default>
</test>
<!--
Expand Down

0 comments on commit 97caf12

Please sign in to comment.