Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::StackAffectingOps Class Reference

The set of CALL and STORE ops that might indirectly affect stack variables. More...

#include <merge.hh>

Inheritance diagram for ghidra::StackAffectingOps:
[legend]
Collaboration diagram for ghidra::StackAffectingOps:
[legend]

Public Member Functions

 StackAffectingOps (Funcdata &fd)
 Constructor.
 
virtual void populate (void)
 Populate the PcodeOp object in this set.
 
virtual bool affectsTest (PcodeOp *op, Varnode *vn) const
 (Secondary) test that the given PcodeOp affects the Varnode
 
- Public Member Functions inherited from ghidra::PcodeOpSet
bool isPopulated (void) const
 Return true if this set is populated.
 
void clear (void)
 Clear all PcodeOps in this.
 

Private Attributes

Funcdatadata
 The function containing these ops.
 

Additional Inherited Members

- Static Public Member Functions inherited from ghidra::PcodeOpSet
static bool compareByBlock (const PcodeOp *a, const PcodeOp *b)
 Compare PcodeOps for this set.
 
- Protected Member Functions inherited from ghidra::PcodeOpSet
void addOp (PcodeOp *op)
 Add a PcodeOp into the set.
 
void finalize (void)
 Sort ops in the set into blocks.
 

Detailed Description

The set of CALL and STORE ops that might indirectly affect stack variables.

Intersect tests between local address tied and non-address tied Varnodes need to check for possible uses of aliases to the address tied Varnode. This object is populated with the set of PcodeOps through which any stack Varnode might be modified through an alias. Given an intersection of the Cover of an address tied Varnode and a PcodeOp in this set, affectsTest() can do secondary testing of whether the Varnode is actually modified by the PcodeOp.

Member Function Documentation

◆ affectsTest()

bool ghidra::StackAffectingOps::affectsTest ( PcodeOp op,
Varnode vn 
) const
virtual

(Secondary) test that the given PcodeOp affects the Varnode

This method is called after an intersection of a PcodeOp in this set with a Varnode Cover has been determined. This allows the owner to make a final determination if merging should be prevented.

Parameters
opis the PcodeOp that intersects with the Varnode Cover
vnis the Varnode whose Cover is intersected
Returns
true if merging should be prevented

Implements ghidra::PcodeOpSet.

References ghidra::PcodeOp::code(), ghidra::CPUI_STORE, data, ghidra::Varnode::getAddr(), ghidra::Funcdata::getStoreGuard(), and ghidra::LoadGuard::isGuarded().

◆ populate()

void ghidra::StackAffectingOps::populate ( void  )
virtual

Populate the PcodeOp object in this set.

Call-back to the owner to lazily add PcodeOps to this set. The override method calls addOp() for each PcodeOp it wants to add, then calls finalize() to make this set ready for intersection tests.

Implements ghidra::PcodeOpSet.

References ghidra::PcodeOpSet::addOp(), ghidra::CPUI_STORE, data, ghidra::PcodeOpSet::finalize(), ghidra::Funcdata::getCallSpecs(), ghidra::FuncCallSpecs::getOp(), ghidra::Funcdata::getStoreGuards(), and ghidra::Funcdata::numCalls().


The documentation for this class was generated from the following files: