[mips] Fix crash on recursive using of .set
authorSimon Atanasyan <simon@atanasyan.com>
Tue, 19 Mar 2019 15:15:35 +0000 (15:15 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Tue, 19 Mar 2019 15:15:35 +0000 (15:15 +0000)
commitaf40d4371d89d9c4a9be2e4bef3266577bd9ff3f
tree9fac052d4737d43aa4e2b85d8dcc6630906e0754
parent00160e226f68c87f70b7e9cae464c51339a28026
[mips] Fix crash on recursive using of .set

Switch to the `MCParserUtils::parseAssignmentExpression` for parsing
assignment expressions in the `.set` directive reduces code and allows
to print an error message instead of crashing in case of incorrect
recursive using of the `.set`.

Fix for the bug https://bugs.llvm.org/show_bug.cgi?id=41053.

Differential Revision: http://reviews.llvm.org/D59452

llvm-svn: 356461
llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
llvm/test/MC/Mips/set-sym-recursive.s [new file with mode: 0644]