Skip to content

Commit 96a00e6

Browse files
committed
Follow instrDef chain in GetBytecodeArgOutCapture
1 parent 2dfc7ab commit 96a00e6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/Backend/IR.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,6 +3464,11 @@ IR::Instr* Instr::GetBytecodeArgOutCapture()
34643464
this->m_opcode == Js::OpCode::ArgOut_A_InlineBuiltIn);
34653465
Assert(this->m_dst->GetStackSym()->m_isArgCaptured);
34663466
IR::Instr* instr = this->GetSrc1()->GetStackSym()->m_instrDef;
3467+
while (instr->m_opcode != Js::OpCode::BytecodeArgOutCapture)
3468+
{
3469+
Assert(instr->GetSrc1() && instr->GetSrc1()->GetStackSym() && instr->GetSrc1()->GetStackSym()->IsSingleDef());
3470+
instr = instr->GetSrc1()->GetStackSym()->m_instrDef;
3471+
}
34673472
Assert(instr->m_opcode == Js::OpCode::BytecodeArgOutCapture);
34683473
return instr;
34693474
}

test/inlining/callTarget.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,12 @@ test2();
7272
test2();
7373
test2();
7474
WScript.Echo("PASSED\n");
75+
76+
function test3(a, b)
77+
{
78+
return String.prototype.replace.call(a, b, "a")
79+
}
80+
test3("foobar", /foo/i)
81+
test3("foobar", /foo/i)
82+
test3("foobar", /foo/i)
83+
print("passed")

0 commit comments

Comments
 (0)