Fix IR bug when modifier parameter was function return variable

The bug was that function return variables were not part of the m_context.localVariable during
the modifier generation and a looking up them was throwing.
This commit is contained in:
hrkrshnn 2021-02-11 14:44:55 +01:00
parent 1716dcfb57
commit 7786e6d561

View File

@ -323,7 +323,7 @@ string IRGenerator::generateModifier(
t("functionName", functionName);
vector<string> retParamsIn;
for (auto const& varDecl: _function.returnParameters())
retParamsIn += IRVariable(*varDecl).stackSlots();
retParamsIn += m_context.addLocalVariable(*varDecl).stackSlots();
vector<string> params = retParamsIn;
for (auto const& varDecl: _function.parameters())
params += m_context.addLocalVariable(*varDecl).stackSlots();