Skip to content

Commit

Permalink
fixup! [AsmWriter] Ensure getMnemonic doesn't return invalid pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
pratlucas committed Dec 18, 2023
1 parent b048817 commit 1326609
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/MC/MCAsmStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ class MCAsmStreamer final : public MCStreamer {
void emitGNUAttribute(unsigned Tag, unsigned Value) override;

StringRef getMnemonic(MCInst &MI) override {
std::pair<const char *, uint64_t> M = InstPrinter->getMnemonic(&MI);
assert((M.second != 0 || M.first == nullptr) &&
auto [Ptr, Bits] = InstPrinter->getMnemonic(&MI);
assert((Bits != 0 || Ptr == nullptr) &&
"Invalid char pointer for instruction with no mnemonic");
return M.first;
return Ptr;
}

void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
Expand Down

0 comments on commit 1326609

Please sign in to comment.