Skip to content

Commit 5210a36

Browse files
author
Meghana Gupta
committed
[MERGE #5930 @meg-gupta] OS#18874701: Clear valuetype of profiledInstr, when it transforms from LdElemI_A to Ld_A
Merge pull request #5930 from meg-gupta:vtbug Otherwise we may end up reading the profiled value type stored in the union (instr->AsProfiledInstr()->u) incorrectly.
2 parents d455ac4 + 99744e4 commit 5210a36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Backend/GlobOpt.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13270,6 +13270,11 @@ GlobOpt::OptStackArgLenAndConst(IR::Instr* instr, Value** src1Val)
1327013270
{
1327113271
instr->ClearBailOutInfo();
1327213272
}
13273+
if (instr->IsProfiledInstr())
13274+
{
13275+
Assert(opcode == Js::OpCode::Ld_A || opcode == Js::OpCode::Typeof);
13276+
instr->AsProfiledInstr()->u.FldInfo().valueType = ValueType::Uninitialized;
13277+
}
1327313278
*src1Val = this->OptSrc(instr->GetSrc1(), &instr);
1327413279
instr->m_func->hasArgLenAndConstOpt = true;
1327513280
};

0 commit comments

Comments
 (0)