This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
These three bugs are to do with inline ASM statements containing invalid inputs/outputs that trigger ICEs in various part of the compiler not prepared to handle error_mark_nodes. Since all of these bugs are very similiar in nature and the proposed fixes is both small and touches the same piece of code, I have grouped them all together rather than break them up into separate patches.
The attached patch catches these invalid statements in the parser by adding two checks to cp_parser_asm_definition for the parsing of inputs and outputs. In each case it looks to see if the parsed statement was invalid, in which case an error will already have been issued to that effect and discards those statements found to be invalid. This approach seemed cleaner to me than adding in checks for error_mark_nodes to the affected places but I can test a patch to do that if it's deemed a better aproach.
Bootstrapped and regression tested on i686-pc-linux-gnu with no new regressions. Ok for mainline and release branches?
Cheers, Lee.
cp/ PR c++/30849 PR c++/30850 PR c++/30851 * parser.c (cp_parser_asm_definition): Detect and discard asm statements with invalid inputs or outputs.
testsuite/ PR c++/30849 * g++.dg/parse/asm1.C: New test.
PR c++/30850 * g++.dg/parse/asm2.C: Likewise.
PR c++/30851 * g++.dg/parse/asm3.C: Likewise.
Attachment:
patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |