[PATCH] D71477: [mips] Add an assert in getTargetStreamer()
Miloš Stojanović via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 10:06:33 PST 2019
mstojanovic created this revision.
mstojanovic added reviewers: atanasyan, petarj.
Herald added subscribers: hiraditya, arichardson, sdardis.
Herald added a project: LLVM.
Check if the TargetStreamer can be accesed.
https://reviews.llvm.org/D71477
Files:
llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Index: llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
===================================================================
--- llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -134,6 +134,8 @@
class MipsAsmParser : public MCTargetAsmParser {
MipsTargetStreamer &getTargetStreamer() {
+ assert(getParser().getStreamer().getTargetStreamer() &&
+ "do not have a target streamer");
MCTargetStreamer &TS = *getParser().getStreamer().getTargetStreamer();
return static_cast<MipsTargetStreamer &>(TS);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71477.233827.patch
Type: text/x-patch
Size: 586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191213/c0256c8d/attachment-0001.bin>
More information about the llvm-commits
mailing list