BPFEmitter: Amend instruction class checking in HandleStore()

This was previously checking for a load class, which would result in ST
clobbering the index register.
This commit is contained in:
LC committed 2026-07-11 12:26:11 -04:00
1 parent d2f096187c
commit e021a55abd
1 file changed
+1 -1
@@ -110,7 +110,7 @@ uint64_t BPFEmitter::HandleStore(uint32_t BPFIP, const sock_filter* Inst) {
[[maybe_unused]] size_t OpSize {};
const auto SrcReg = BPF_CLASS(Inst->code) == BPF_LD ? REG_A : REG_X;
const auto SrcReg = BPF_CLASS(Inst->code) == BPF_ST ? REG_A : REG_X;
// Must be smaller than scratch space size.
VALIDATE(Inst->k < 16);