angr.go.optimization_passes.type_switch_simplifier¶
- class angr.go.optimization_passes.type_switch_simplifier.GoTypeSwitchSimplifier¶
Bases:
OptimizationPass,CFGTransformationMixinStrip the search machinery the compiler puts in front of a type switch.
Concrete cases are found through a binary search over
t.Hashwhose leaves comparetagainst the case’s type descriptor; the hash tests are redundant with those comparisons, so the tree collapses into a chain of descriptor comparisons. Interface cases (go1.22+) first probe an inline cache before callingruntime.interfaceSwitch; the probe loop is dropped and the call always runs. Assertions and conversions to interface types probe the same kind of cache ahead ofruntime.typeAssert.- ARCHES = None¶
- PLATFORMS = None¶
- STAGE: OptimizationPassStage = 7¶
- NAME = 'Simplify Go type switches'¶
- __init__(func, manager, **kwargs)¶