mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9051 from ethereum/smt_fix_callstack
[SMTChecker] Fix ICE in inlining function calls while short circuiting
This commit is contained in:
commit
79f4a2b476
@ -26,6 +26,7 @@ Bugfixes:
|
|||||||
* Scanner: Fix bug when two empty NatSpec comments lead to scanning past EOL.
|
* Scanner: Fix bug when two empty NatSpec comments lead to scanning past EOL.
|
||||||
* Code Generator: Trigger proper unimplemented errors on certain array copy operations.
|
* Code Generator: Trigger proper unimplemented errors on certain array copy operations.
|
||||||
* SMTChecker: Fix internal error when applying arithmetic operators to fixed point variables.
|
* SMTChecker: Fix internal error when applying arithmetic operators to fixed point variables.
|
||||||
|
* SMTChecker: Fix internal error when short circuiting Boolean expressions with function calls in state variable initialization.
|
||||||
|
|
||||||
### 0.6.8 (2020-05-14)
|
### 0.6.8 (2020-05-14)
|
||||||
|
|
||||||
|
@ -1791,7 +1791,6 @@ Expression const* SMTEncoder::leftmostBase(IndexAccess const& _indexAccess)
|
|||||||
|
|
||||||
set<VariableDeclaration const*> SMTEncoder::touchedVariables(ASTNode const& _node)
|
set<VariableDeclaration const*> SMTEncoder::touchedVariables(ASTNode const& _node)
|
||||||
{
|
{
|
||||||
solAssert(!m_callStack.empty(), "");
|
|
||||||
vector<CallableDeclaration const*> callStack;
|
vector<CallableDeclaration const*> callStack;
|
||||||
for (auto const& call: m_callStack)
|
for (auto const& call: m_callStack)
|
||||||
callStack.push_back(call.first);
|
callStack.push_back(call.first);
|
||||||
|
@ -33,7 +33,8 @@ set<VariableDeclaration const*> VariableUsage::touchedVariables(ASTNode const& _
|
|||||||
m_touchedVariables.clear();
|
m_touchedVariables.clear();
|
||||||
m_callStack.clear();
|
m_callStack.clear();
|
||||||
m_callStack += _outerCallstack;
|
m_callStack += _outerCallstack;
|
||||||
m_lastCall = m_callStack.back();
|
if (!m_callStack.empty())
|
||||||
|
m_lastCall = m_callStack.back();
|
||||||
_node.accept(*this);
|
_node.accept(*this);
|
||||||
return m_touchedVariables;
|
return m_touchedVariables;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
pragma experimental SMTChecker;
|
||||||
|
contract c {
|
||||||
|
bool b = (f() == 0) && (f() == 0);
|
||||||
|
function f() internal returns (uint) {}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user