[PATCH] [mips] Make the MipsAsmParser capable of knowing whether PIC mode is enabled or not.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Nov 10 21:10:40 PST 2014


> It turns out that doing this causes crashes and while looking into it again we've noticed something strange. It seems MipsAsmParser::Parser shadows MCAsmParserExtension::Parser. As a result, calling getContext() (which returns getParser().getContext()) may crash when getParser().getContext() is fine. The difference seems to be that getContext() uses MCAsmParserExtension::getParser() and MCAsmParserExtension::Parser whereas getParser().getContext() uses MipsAsmParser::getParser() and MipsAsmParser::Parser. MipsAsmParser::Parser is initialized by the constructor but (I think) MCAsmParserExtension is not.
>
> @rafael: All the targets seem to do the same thing. Was it intentional?

It was a bug. Fixed in r221667.

Cheers,
Rafael




More information about the llvm-commits mailing list