Skip to content

Commit b19ae63

Browse files
committed
fix bug, after functionBody cleaned up, it's still accessing m_scriptContext
1 parent e47ba38 commit b19ae63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/Runtime/Base/ScriptContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ namespace Js
600600
// because otherwise ETW events might not get fired if a GC doesn't happen
601601
// and the thread context isn't shut down cleanly (process detach case)
602602
this->MapFunction([this](Js::FunctionBody* functionBody) {
603-
Assert(functionBody->GetScriptContext() == this);
603+
Assert(functionBody->GetScriptContext() == nullptr || functionBody->GetScriptContext() == this);
604604
functionBody->Cleanup(/* isScriptContextClosing */ true);
605605
});
606606
}

Lib/Runtime/Library/ScriptFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ namespace Js
594594
{
595595
memset(this->m_inlineCaches[i], 0, sizeof(InlineCache));
596596
}
597-
else if(!scriptContext->IsClosed())
597+
else if(scriptContext != nullptr && !scriptContext->IsClosed())
598598
{
599599
if (inlineCache->RemoveFromInvalidationList())
600600
{

0 commit comments

Comments
 (0)