MCPcopy Create free account
hub / github.com/argotorg/solidity / defineGlobalVariable

Method defineGlobalVariable

libsolidity/formal/SMTEncoder.cpp:1782–1800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1780}
1781
1782void SMTEncoder::defineGlobalVariable(std::string const& _name, Expression const& _expr, bool _increaseIndex)
1783{
1784 if (!m_context.knownGlobalSymbol(_name))
1785 {
1786 bool abstract = m_context.createGlobalSymbol(_name, _expr);
1787 if (abstract)
1788 m_unsupportedErrors.warning(
1789 1695_error,
1790 _expr.location(),
1791 "Assertion checker does not yet support this global variable."
1792 );
1793 }
1794 else if (_increaseIndex)
1795 m_context.globalSymbol(_name)->increaseIndex();
1796 // The default behavior is not to increase the index since
1797 // most of the global values stay the same throughout a tx.
1798 if (isSupportedType(*_expr.annotation().type))
1799 defineExpr(_expr, m_context.globalSymbol(_name)->currentValue());
1800}
1801
1802bool SMTEncoder::shortcutRationalNumber(Expression const& _expr)
1803{

Callers

nothing calls this directly

Calls 8

isSupportedTypeFunction · 0.85
knownGlobalSymbolMethod · 0.80
createGlobalSymbolMethod · 0.80
globalSymbolMethod · 0.80
warningMethod · 0.45
locationMethod · 0.45
increaseIndexMethod · 0.45
currentValueMethod · 0.45

Tested by

no test coverage detected