Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
deps: update ChakraCore to chakra-core/ChakraCore@3b8a6ebedf
Browse files Browse the repository at this point in the history
[MERGE #4660 @sigatrev] OS#14057294: don't use param scope for jit loop bodies

Merge pull request #4660 from sigatrev:loopScope

jit loop bodies start past the instruction that ends param scope when param and body scopes are split, leading to a Throw::FatalInternalError when there are more scope slots than param scope slots

Reviewed-By: chakrabot <[email protected]>
  • Loading branch information
sigatrev authored and kfarnung committed Mar 7, 2018
1 parent 46d22a7 commit 8181617
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deps/chakrashim/core/lib/Backend/IRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ IRBuilder::Build()
m_func->m_tailInstr = m_func->m_exitInstr;
m_func->m_headInstr->InsertAfter(m_func->m_tailInstr);

if (m_func->GetJITFunctionBody()->IsParamAndBodyScopeMerged())
if (m_func->GetJITFunctionBody()->IsParamAndBodyScopeMerged() || this->IsLoopBody())
{
this->SetParamScopeDone();
}
Expand Down
22 changes: 22 additions & 0 deletions deps/chakrashim/core/test/Bugs/bug14057294.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

function foo(a, b = (function() {a;})())
{
for (var ii = 0; ii < 200; ++ii)
{
var c, d = null;
function bar()
{
c;
d;
};
bar();
}
};

foo();

WScript.Echo("Pass")
5 changes: 5 additions & 0 deletions deps/chakrashim/core/test/Bugs/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,9 @@
<compile-flags>-args summary -endargs</compile-flags>
</default>
</test>
<test>
<default>
<files>bug14057294.js</files>
</default>
</test>
</regress-exe>

0 comments on commit 8181617

Please sign in to comment.