package bap-std

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

base class for BIR interpreters

constraint 'a = context
inherit 'a expi
method enter_term : 't 'p. ('p, 't) cls -> 't term -> 'a Bil.Result.u

called for each term, just after the position is updated, but before any side effect of term evaluation had occurred.

method eval : 't 'p. ('p, 't) cls -> 't term -> 'a Bil.Result.u
method leave_term : 't 'p. ('p, 't) cls -> 't term -> 'a Bil.Result.u

called after all side effects of the term has occurred

method eval_sub : sub term -> 'a Bil.Result.u

Evaluates a subroutine with the following algorithm:

0. next <- first block of subroutine and goto 1 1. eval all in and in/out arguments and goto 2 2. if next is some blk then eval it and goto 2 else goto 3 3. if next is some sub then eval it and goto 2 else goto 4 4. eval all out and in/out arguments.

method eval_arg : arg term -> 'a Bil.Result.u

evaluate argument by first evaluating its right hand side, and then assigning the result to the left hand side.

method eval_blk : blk term -> 'a Bil.Result.u

evaluate all terms in a given block, starting with phi nodes, then proceeding to def nodes and finally evaluating all jmp terms until either jump is taken or jump condition is undefined. After the evaluation the context#next will point next destination.

method eval_def : def term -> 'a Bil.Result.u

evaluate definition by assigning the result of the right hand side to the definition variable

method eval_phi : phi term -> 'a Bil.Result.u

based on trace select an expression and assign its value to the left hand side of phi node.

method eval_jmp : jmp term -> 'a Bil.Result.u

evaluate condition, and if it is false, then do nothing, otherwise evaluate jump target (see below)

method eval_goto : label -> 'a Bil.Result.u

evaluate label, using eval_direct or eval_indirect, based on the label variant

method eval_call : call -> 'a Bil.Result.u

evaluate target label, using eval_direct or eval_indirect, based on the label variant. Ignores return label.

method eval_ret : label -> 'a Bil.Result.u

evaluate label, using eval_direct or eval_indirect, based on the label variant

method eval_exn : int -> tid -> 'a Bil.Result.u

ignore arguments and set context#next to None

method eval_direct : tid -> 'a Bil.Result.u

set context#next to the a given tid

method eval_indirect : exp -> 'a Bil.Result.u

ignore argument and set context#next to None

OCaml

Innovation. Community. Security.