GP-4226 Detect BRANCHIND used as a RETURN

This commit is contained in:
caheckman 2024-01-12 20:48:09 +00:00
parent dffb5fd859
commit e655ab3cb3
8 changed files with 115 additions and 37 deletions

View file

@ -525,6 +525,16 @@ public:
/// It knows how to map from specific switch variable values to the destination
/// \e case block and how to label the value.
class JumpTable {
public:
/// \brief Recovery status for a specific JumpTable
enum RecoveryMode {
success = 0, ///< JumpTable is fully recovered
fail_normal = 1, ///< Normal failure to recover
fail_thunk = 2, ///< Likely \b thunk
fail_noflow = 3, ///< No legal flow to BRANCHIND
fail_return = 4 ///< Likely \b return operation
};
private:
/// \brief An address table index and its corresponding out-edge
struct IndexPair {
int4 blockPosition; ///< Out-edge index for the basic-block