MCPcopy Create free account
hub / github.com/avast/retdec / getConfigStackVariable

Method getConfigStackVariable

src/bin2llvmir/optimizations/stack/stack.cpp:329–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329const retdec::common::Object* StackAnalysis::getConfigStackVariable(
330 llvm::Function* fnc,
331 SymbolicTree& root)
332{
333 auto baseOffset = getBaseOffset(root);
334 if (!baseOffset.has_value())
335 {
336 return nullptr;
337 }
338
339 auto cfn = _config->getConfigFunction(fnc);
340 if (cfn && _config->getLlvmStackVariable(fnc, baseOffset.value()) == nullptr)
341 {
342 for (auto& var: cfn->locals)
343 {
344 if (var.getStorage().getStackOffset() == baseOffset)
345 {
346 return &var;
347 }
348 }
349 }
350
351 return nullptr;
352}
353
354} // namespace bin2llvmir
355} // namespace retdec

Callers

nothing calls this directly

Calls 4

getConfigFunctionMethod · 0.80
getLlvmStackVariableMethod · 0.80
getStackOffsetMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected