Skip to content

Commit ff72e95

Browse files
committed
[MERGE #5209 @rajatd] Changing an assert in globopt to correctly reflect the invariant
Merge pull request #5209 from rajatd:liveVarSyms
2 parents 3162205 + cdec97e commit ff72e95

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

lib/Backend/GlobOptBailOut.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,6 @@ void GlobOpt::RecordInlineeFrameInfo(IR::Instr* inlineeEnd)
784784
}
785785
}
786786

787-
GlobOptBlockData& globOptData = this->currentBlock->globOptData;
788-
789787
if (frameInfo->intSyms->TestEmpty() && frameInfo->intSyms->Test(argSym->m_id))
790788
{
791789
// Var version of the sym is not live, use the int32 version
@@ -800,7 +798,7 @@ void GlobOpt::RecordInlineeFrameInfo(IR::Instr* inlineeEnd)
800798
}
801799
else
802800
{
803-
Assert(globOptData.liveVarSyms->Test(argSym->m_id));
801+
Assert(frameInfo->varSyms->Test(argSym->m_id));
804802
}
805803

806804
if (argSym->IsConst() && !argSym->IsInt64Const())

test/Optimizer/rlexe.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,12 @@
14771477
<compile-flags>-mic:1 -off:simplejit</compile-flags>
14781478
</default>
14791479
</test>
1480+
<test>
1481+
<default>
1482+
<files>test149.js</files>
1483+
<compile-flags>-mic:1 -off:simplejit -bgjit- -force:fixdataprops -lic:1</compile-flags>
1484+
</default>
1485+
</test>
14801486
<test>
14811487
<default>
14821488
<files>IsIn_ArrayNoMissingValues.js</files>

test/Optimizer/test149.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//-------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
//-------------------------------------------------------------------------------------------------------
5+
6+
function makeArrayLength() {
7+
return 1;
8+
}
9+
var obj0 = {};
10+
var arrObj0 = {};
11+
var func3 = function () {
12+
arrObj0[1] = 1;
13+
return obj0.length;
14+
};
15+
16+
obj0.method0 = func3;
17+
var h = 1;
18+
obj0.length = makeArrayLength();
19+
var __loopvar1 = 1;
20+
do {
21+
h = obj0.method0(h);
22+
} while (obj0.method0() && __loopvar1++ < 10);
23+
print("passed");

0 commit comments

Comments
 (0)