@@ -1319,6 +1319,7 @@ CompilerValue *LLVMCodeBuilder::addListItem(List *list, CompilerValue *index)
13191319 ins->functionReturnReg = ret.get ();
13201320
13211321 m_instructions.push_back (ins);
1322+ m_listInstructions.push_back (m_instructions.back ());
13221323 return addReg (ret, ins);
13231324}
13241325
@@ -1330,7 +1331,9 @@ CompilerValue *LLVMCodeBuilder::addListItemIndex(List *list, CompilerValue *item
13301331 if (m_listPtrs.find (list) == m_listPtrs.cend ())
13311332 m_listPtrs[list] = LLVMListPtr ();
13321333
1333- return createOp (ins, Compiler::StaticType::Number, Compiler::StaticType::Unknown, { item });
1334+ auto ret = createOp (ins, Compiler::StaticType::Number, Compiler::StaticType::Unknown, { item });
1335+ m_listInstructions.push_back (m_instructions.back ());
1336+ return ret;
13341337}
13351338
13361339CompilerValue *LLVMCodeBuilder::addListContains (List *list, CompilerValue *item)
@@ -1341,7 +1344,9 @@ CompilerValue *LLVMCodeBuilder::addListContains(List *list, CompilerValue *item)
13411344 if (m_listPtrs.find (list) == m_listPtrs.cend ())
13421345 m_listPtrs[list] = LLVMListPtr ();
13431346
1344- return createOp (ins, Compiler::StaticType::Bool, Compiler::StaticType::Unknown, { item });
1347+ auto ret = createOp (ins, Compiler::StaticType::Bool, Compiler::StaticType::Unknown, { item });
1348+ m_listInstructions.push_back (m_instructions.back ());
1349+ return ret;
13451350}
13461351
13471352CompilerValue *LLVMCodeBuilder::addListSize (List *list)
@@ -1593,6 +1598,8 @@ void LLVMCodeBuilder::createListAppend(List *list, CompilerValue *item)
15931598
15941599 if (m_listPtrs.find (list) == m_listPtrs.cend ())
15951600 m_listPtrs[list] = LLVMListPtr ();
1601+
1602+ m_listInstructions.push_back (m_instructions.back ());
15961603}
15971604
15981605void LLVMCodeBuilder::createListInsert (List *list, CompilerValue *index, CompilerValue *item)
@@ -1603,6 +1610,8 @@ void LLVMCodeBuilder::createListInsert(List *list, CompilerValue *index, Compile
16031610
16041611 if (m_listPtrs.find (list) == m_listPtrs.cend ())
16051612 m_listPtrs[list] = LLVMListPtr ();
1613+
1614+ m_listInstructions.push_back (m_instructions.back ());
16061615}
16071616
16081617void LLVMCodeBuilder::createListReplace (List *list, CompilerValue *index, CompilerValue *item)
@@ -1613,6 +1622,8 @@ void LLVMCodeBuilder::createListReplace(List *list, CompilerValue *index, Compil
16131622
16141623 if (m_listPtrs.find (list) == m_listPtrs.cend ())
16151624 m_listPtrs[list] = LLVMListPtr ();
1625+
1626+ m_listInstructions.push_back (m_instructions.back ());
16161627}
16171628
16181629void LLVMCodeBuilder::beginIfStatement (CompilerValue *cond)
0 commit comments