angr.go.optimization_passes.runtime_rewriter

Turn calls into the Go runtime for maps, channels, goroutines, defer and panic/recover back into the Go statements they were compiled from. See angr.go.codegen_builtins for the go_render tag protocol the results use.

angr.go.optimization_passes.runtime_rewriter.classify_runtime_call(name)
Return type:

str | None

Parameters:

name (str | None)

class angr.go.optimization_passes.runtime_rewriter.GoRuntimeRewriter

Bases: OptimizationPass

Rewrite Go runtime calls into map, channel, goroutine, defer and panic/recover statements.

Map slot pointers returned by mapaccess1/mapassign are folded into the loads and the store that go through them (m[k], m[k] = v); results the runtime writes through a stack pointer (chanrecv) become the value of the rewritten call; open-coded defers (a deferBits byte plus an inline call at every exit) become defer.

ARCHES = None
PLATFORMS = None
STAGE: OptimizationPassStage = 7
NAME = 'Rewrite Go runtime calls into Go statements'
__init__(func, manager, **kwargs)
nested_makemap(call)

make(map[K]V[, hint]) for a makemap call that is not the source of a definition.

Return type:

Call | None

Parameters:

call (Call)

index_call(m, k, bits, tags)
Return type:

Call

Parameters:
assign_call(m, k, v, tags)
Return type:

Call

Parameters:
func_value_call(call)

(*f)(args...) through a func value becomes f(args...) with the signature’s arity.

Return type:

Call | None

Parameters:

call (Call)