angr.go.optimization_passes.stack_inits¶
Stack initializations the compiler expands inline.
make(map[K]V) of a map that does not escape (go1.24+ swiss maps): the compiler places the maps.Map header and
one group on the stack, zeroes both, marks the group’s control word empty, points dirPtr at the group and seeds
the hash with runtime.rand(). The whole sequence becomes m := make(map[K]V) and &header becomes m.
Large zero values are cleared by a loop over the variable (plus stores for the tail); that is one memset.
- class angr.go.optimization_passes.stack_inits.SmallMapFolder¶
Bases:
_StackScanSee the module docstring.
- class angr.go.optimization_passes.stack_inits.StackClearFolder¶
Bases:
_StackScanA loop clearing a stack variable
stridebytes per trip, plus the stores clearing its tail, is onememset(&v, 0, size); the code generator spells a whole-variable clear asv = T{}.
- class angr.go.optimization_passes.stack_inits.GoSmallMapFolder¶
Bases:
OptimizationPass,CFGTransformationMixinmake(map[K]V)of a non-escaping map, inlined onto the stack (see the module docstring). Runs before the map accesses are rewritten, while their type descriptors still name the map type.- ARCHES = None¶
- PLATFORMS = None¶
- STAGE: OptimizationPassStage = 7¶
- NAME = 'Fold Go stack-allocated map initializations'¶
- __init__(func, manager, **kwargs)¶