[X86AsmBackend] Define reset() hook (#213409)

Noticed when reviewing #175830: MCObjectStreamer::reset frees the
fragments PendingBA and PrevInstPosition point into, but X86AsmBackend
keeps them. Define the hook.
This commit is contained in:
Fangrui Song 2026-07-31 22:35:03 -07:00 committed by GitHub
parent 9a15298e96
commit d9e699957d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,6 +163,13 @@ public:
AllowAutoPadding && TargetPrefixMax != 0 && X86PadForBranchAlign;
}
void reset() override {
PrevInst = MCInst();
PrevInstOpcode = 0;
PendingBA = nullptr;
PrevInstPosition = {};
}
void emitInstructionBegin(MCObjectStreamer &OS, const MCInst &Inst,
const MCSubtargetInfo &STI);
void emitInstructionEnd(MCObjectStreamer &OS, const MCInst &Inst);