package bap-std

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

BIR interpreter

  • deprecated

    Use the Primus Framework

constraint 'a = Biri.context
inherit 'a Biri.Expi.t
method enter_term : 't 'p. ('p, 't) cls -> 't term -> 'a Biri.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 Biri.u

eval cls t evaluates a term t of the cls class. The method implementation will call the enter_term method, and then will dispatch to the eval_XXX method, where XXX is a name of a term corresponding to cls. Finally, the leave_term method is called.

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

called after all side effects of the term has occurred

method eval_sub : sub term -> 'a Biri.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 Biri.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 Biri.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 Biri.u

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

method eval_phi : phi term -> 'a Biri.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 Biri.u

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

method eval_goto : label -> 'a Biri.u

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

method eval_call : call -> 'a Biri.u

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

method eval_ret : label -> 'a Biri.u

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

method eval_exn : int -> tid -> 'a Biri.u

ignore arguments and set context#next to None

method eval_direct : tid -> 'a Biri.u

set context#next to the a given tid

method eval_indirect : exp -> 'a Biri.u

ignore argument and set context#next to None

OCaml

Innovation. Community. Security.