mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix bug in call statement generator
This commit is contained in:
parent
954bcf95ea
commit
a0197138d9
@ -715,10 +715,6 @@ string FunctionCallGenerator::callStmt(shared_ptr<FunctionState> _callee)
|
|||||||
string rhsExpr;
|
string rhsExpr;
|
||||||
bool callValid = true;
|
bool callValid = true;
|
||||||
|
|
||||||
// Create lhs expression only if function outputs non-zero return values.
|
|
||||||
if (!_callee->outputs.empty())
|
|
||||||
lhsExpr = lhs(_callee->outputs);
|
|
||||||
|
|
||||||
// Create arguments only if function contains non-zero input parameters.
|
// Create arguments only if function contains non-zero input parameters.
|
||||||
if (!_callee->inputs.empty())
|
if (!_callee->inputs.empty())
|
||||||
{
|
{
|
||||||
@ -734,9 +730,15 @@ string FunctionCallGenerator::callStmt(shared_ptr<FunctionState> _callee)
|
|||||||
rhsExpr = (_callee->type->functionScope() ? "" : "this.") + _callee->name + "();";
|
rhsExpr = (_callee->type->functionScope() ? "" : "this.") + _callee->name + "();";
|
||||||
|
|
||||||
if (callValid)
|
if (callValid)
|
||||||
|
{
|
||||||
|
// Create lhs expression only if function outputs non-zero return values.
|
||||||
|
if (!_callee->outputs.empty())
|
||||||
|
lhsExpr = lhs(_callee->outputs);
|
||||||
callStmtStream << indentation()
|
callStmtStream << indentation()
|
||||||
<< lhsExpr
|
<< lhsExpr
|
||||||
<< rhsExpr;
|
<< rhsExpr;
|
||||||
|
}
|
||||||
|
|
||||||
callStmtStream << "\n";
|
callStmtStream << "\n";
|
||||||
return callStmtStream.str();
|
return callStmtStream.str();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user