angr.go.optimization_passes.check_remover

angr.go.optimization_passes.check_remover.is_go_check_panic_name(name)
Return type:

bool

Parameters:

name (str | None)

angr.go.optimization_passes.check_remover.is_go_write_barrier_name(name)
Return type:

bool

Parameters:

name (str | None)

class angr.go.optimization_passes.check_remover.GoCheckRemover

Bases: OptimizationPass, CFGTransformationMixin

Remove compiler-inserted checks whose failure path is a panic stub, and GC write-barrier slow paths.

A bounds/division check branches to a sink block that only spills the operands and calls a runtime.panic* helper; the block and the branch to it are dropped, so s[i] reads as an index expression again. A pointer store compiles to if runtime.writeBarrier.enabled { gcWriteBarrierN(); buf[...] = ... } followed by the real store on the join block; the barrier block only records the old and new pointers for the GC, so it and the branch are dropped as well.

ARCHES = None
PLATFORMS = None
STAGE: OptimizationPassStage = 1
NAME = 'Remove Go bounds/division checks and write barriers'
__init__(func, manager, **kwargs)