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

Method removeVariablesAboveStackHeight

libsolidity/codegen/CompilerContext.cpp:233–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void CompilerContext::removeVariablesAboveStackHeight(unsigned _stackHeight)
234{
235 std::vector<Declaration const*> toRemove;
236 for (auto _var: m_localVariables)
237 {
238 solAssert(!_var.second.empty(), "");
239 solAssert(_var.second.back() <= stackHeight(), "");
240 if (_var.second.back() >= _stackHeight)
241 toRemove.push_back(_var.first);
242 }
243 for (auto _var: toRemove)
244 removeVariable(*_var);
245}
246
247unsigned CompilerContext::numberOfLocalVariables() const
248{

Callers 2

visitMethod · 0.80
popScopedVariablesMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected