angr.analyses.decompiler.known_patterns.protobuf_hasbitsΒΆ

protobuf has-bits accessors (protoc output for optional fields):

has_field()  -> _has_bits_[w] & mask          (Load(m) And mask)
set_has()    -> _has_bits_[w] |= mask          (Store(m, Load(m) Or mask))
clear_has()  -> _has_bits_[w] &= ~mask         (Store(m, Load(m) And ~mask))

The _has_bits_ word is a 32-bit int regardless of architecture, so the load width is fixed at 4. Generic bitfield ops, so opt-in; the mask is captured as an extra call argument. Calibrated against tests/x86_64/decompiler/known_patterns_protobuf (g++ -O2).