klee
klee::OvershiftCheckPass Class Reference

#include <Passes.h>

Inherits llvm::ModulePass.

Public Member Functions

 OvershiftCheckPass ()
 
bool runOnModule (llvm::Module &M) override
 

Static Private Attributes

static char ID
 

Detailed Description

This pass injects checks to check for overshifting.

Overshifting is where a Shl, LShr or AShr is performed where the shift amount is greater than width of the bitvector being shifted. In LLVM (and in C/C++) this undefined behaviour!

Example:

unsigned char x=15;
x << 4 ; // Defined behaviour
x << 8 ; // Undefined behaviour
x << 255 ; // Undefined behaviour

Definition at line 117 of file Passes.h.

Constructor & Destructor Documentation

◆ OvershiftCheckPass()

klee::OvershiftCheckPass::OvershiftCheckPass ( )
inline

Definition at line 121 of file Passes.h.

Member Function Documentation

◆ runOnModule()

bool OvershiftCheckPass::runOnModule ( llvm::Module &  M)
override

Definition at line 93 of file Checks.cpp.

References klee::KleeIRMetaData::addAnnotation(), and klee::KleeIRMetaData::hasAnnotation().

Here is the call graph for this function:

Member Data Documentation

◆ ID

char OvershiftCheckPass::ID
staticprivate

Definition at line 118 of file Passes.h.


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