B2R2


Expr Type

Basic expressions similar to LowUIR.Expr.

Union cases

Union case Description

BinOp(BinOpType, RegType, Expr, Expr)

Full Usage: BinOp(BinOpType, RegType, Expr, Expr)

Parameters:

Binary operation such as add, sub, etc. The second argument is a result type after applying BinOp.

Item1 : BinOpType
Item2 : RegType
Item3 : Expr
Item4 : Expr

Cast(CastKind, RegType, Expr)

Full Usage: Cast(CastKind, RegType, Expr)

Parameters:

Type casting expression. The first argument is a casting type, and the second argument is a result type.

Item1 : CastKind
Item2 : RegType
Item3 : Expr

Extract(Expr, RegType, StartPos)

Full Usage: Extract(Expr, RegType, StartPos)

Parameters:

Extraction expression. The first argument is target expression, and the second argument is the number of bits for extraction, and the third is the start position.

Item1 : Expr
Item2 : RegType
Item3 : StartPos

FuncName string

Full Usage: FuncName string

Parameters:
    Item : string

Name of uninterpreted function.

Item : string

Ite(Expr, RegType, Expr, Expr)

Full Usage: Ite(Expr, RegType, Expr, Expr)

Parameters:

If-then-else expression. The first expression is a condition, second argument is a result type, and the third and the fourth are true and false expression respectively.

Item1 : Expr
Item2 : RegType
Item3 : Expr
Item4 : Expr

Load(Variable, RegType, Expr)

Full Usage: Load(Variable, RegType, Expr)

Parameters:

Memory lookup such as [T_1]:I32

Item1 : Variable
Item2 : RegType
Item3 : Expr

Nil

Full Usage: Nil

Nil value for cons cells.

Num BitVector

Full Usage: Num BitVector

Parameters:

A number. For example, (0x42:I32) is a 32-bit number 0x42

Item : BitVector

RelOp(RelOpType, RegType, Expr, Expr)

Full Usage: RelOp(RelOpType, RegType, Expr, Expr)

Parameters:

Relative operation such as eq, lt, etc. The second argument is a result type.

Item1 : RelOpType
Item2 : RegType
Item3 : Expr
Item4 : Expr

ReturnVal(fnAddr, retAddr, Variable)

Full Usage: ReturnVal(fnAddr, retAddr, Variable)

Parameters:

Value returned from a function located at the address (fnAddr). The second argument indicates the return address (the fall-through address of the call instruction), and the third argument indicates the live definition of previously defined variable. A fake bbl will contain this expression.

fnAddr : Addr
retAddr : Addr
Item3 : Variable

Store(Variable, RegType, Expr, Expr)

Full Usage: Store(Variable, RegType, Expr, Expr)

Parameters:

Memory update such as [T_1] <- T_2. The second argument is a type of stored value.

Item1 : Variable
Item2 : RegType
Item3 : Expr
Item4 : Expr

UnOp(UnOpType, RegType, Expr)

Full Usage: UnOp(UnOpType, RegType, Expr)

Parameters:

Unary operation such as negation. The second argument is a result type.

Item1 : UnOpType
Item2 : RegType
Item3 : Expr

Undefined(RegType, string)

Full Usage: Undefined(RegType, string)

Parameters:

Undefined expression. It is a fatal error when we encounter this expression while evaluating a program. This expression is useful when we encode a label that should not really jump to (e.g., divide-by-zero case).

Item1 : RegType
Item2 : string

Var Variable

Full Usage: Var Variable

Parameters:

A variable.

Item : Variable