Skip to content
Snippets Groups Projects
SMPFunction.h 85.7 KiB
Newer Older
	std::size_t FindSwitchIndexForDefaultCaseAddr(STARS_ea_t DefaultCaseAddr) const; // Search SwitchInfoArray for DefaultCaseAddr, return index
	bool FindPossibleChainAlias(SMPInstr *CurrInst, const STARSOpndTypePtr &DefOp, int SSANum); 
	   // Does the DefOp DEF_USE chain starting at CurrInst contain an indirect mem write?
	bool FindChainAliasHelper(std::list<SMPBasicBlock *>::iterator CurrBlock, const STARSOpndTypePtr &DefOp);
		// recursive helper for global DefOp with DU-chain that traverses CFG
clc5q's avatar
clc5q committed
	void ChainAliasHelper(std::size_t BlockNum); // helper for AliasAnalysis2()
	void FindCounterVariables(void); // Mark NUMERIC (and propagate) any DEF that starts at small immed. value and gets only small inc/dec operations.
	bool CounterVarHelper(const STARSOpndTypePtr &DefOp, int DefSSANum, int BlockNum, bool LocalName, std::list<std::pair<int, STARS_ea_t> > &CounterSSANums); // recursive helper for FindCounterVariables()
	bool ConditionalTypePropagation(void); // Apply SCC algorithm to unresolved Phi DEFs
	bool PropagateSignedness(void); // Propagate signedness FG info from DEFs to USEs whenever there is no USE sign info.
	void MarkSpecialNumericErrorCases(void); // Detect and mark special cases before emitting numeric error annotations.
	void EmitReturnTargetAnnotations(void); // Emit Indirect Branch Target destinations for return instructions in this func.
	void EmitFuncPtrShadowingAnnotations(FILE *InfoAnnotFile); // Emit annotations for func ptr shadowing defense
	bool IsAlreadyShadowed(const ShadowPoint &CriticalOp); // Is CriticalOp already represented in AlreadyShadowed set?
	void EmitShadowingHelper(FILE *InfoAnnotFile, SMPInstr *CurrInst, bool FuncPtr, STARS_ea_t CallAddr); // common code for different cases in shadowing func ptr, critical args
	void EmitFuncPtrShadowingAnnotations2(FILE *InfoAnnotFile); // Emit annotations for func ptr shadowing defense
	void EmitArgShadowingAnnotations(FILE *InfoAnnotFile); // Emit annotations for critical argument shadowing defense
	void EmitStackMemRangeAnnotations(STARSExpression *MemRangeLowerBound, STARSExpression *MemRangeUpperBound, bool PositiveIncrement, const std::set<STARS_ea_t> &StackPtrCopiesSet, std::set<STARS_ea_t> &StaticMemLeaAddrs);
	bool MDFindReturnTypes(void); // Fill ReturnRegTypes[]
	void MDFindIncomingTypes(void); // Fill IncomingRegTypes[]
	bool IsCallerReturnAddressReadOrWritten(void); // Can the return address of any caller be read or written directly from this function?

	friend class STARS_IDA_Function_t;
	friend class STARS_IRDB_Function_t;
}; // end class SMPFunction

#endif