angr.go.optimization_passes.header_word_types

class angr.go.optimization_passes.header_word_types.GoHeaderWordTypes

Bases: OptimizationPass

Keep the length and capacity words of string and slice headers integers. Type inference happily unifies a len word with the pointer word it travels next to and renders (*int8)(n) and unsafe.Pointer locals for what is an int. A variable is proven an integer when it is the len/cap leaf of a fused header (a call argument or a return value), when it is passed where a typed callee takes an integer, or when it is compared in order against the len/cap word of a header; those variables are pinned as ground truth for type inference.

ARCHES = None
PLATFORMS = None
STAGE: OptimizationPassStage = 7
NAME = 'Pin Go header length words to int'
__init__(func, manager, **kwargs)