[mips] Add an assert in getTargetStreamer()

Check if the TargetStreamer can be accessed.

Differential Revision: https://reviews.llvm.org/D71477
This commit is contained in:
Miloš Stojanović 2019-12-16 17:03:18 +01:00
parent d518f1da6d
commit d7efa6b198
1 changed files with 2 additions and 0 deletions

View File

@ -134,6 +134,8 @@ namespace {
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);
}