angr.go.optimization_passes.boxing_rewriter

class angr.go.optimization_passes.boxing_rewriter.GoBoxingRewriter

Bases: OptimizationPass, CFGTransformationMixin

Recover the values behind interface conversions and type assertions.

A value converted to an interface is a (type descriptor or itab, data pointer) pair. Passed directly, the pair is already fused into an interface-typed struct literal; the literal becomes box(x) tagged with the dynamic type. A variadic ...any argument is a stack array of such pairs referenced through a []any header; its element stores are folded into one []any{...} literal and dropped.

A panicking assertion x.(T) is if x.tab != T { panicdottype*() } followed by reads of x.data; the sink and the branch are dropped and the data reads become the assertion.

ARCHES = None
PLATFORMS = None
STAGE: OptimizationPassStage = 7
NAME = 'Recover boxed values behind interface conversions'
__init__(func, manager, **kwargs)
rewrite_struct(expr, block, stmt)
Return type:

Expression | None

Parameters:
fuse_pairs(exprs, stmt)

Adjacent (type descriptor or itab, data word) words in an argument or result list are one interface value: the register pair of a boxed value passed to a callee without a Go prototype, or returned.

Return type:

list

Parameters: