PP: Rationalize return values of MacroExpand.
This results in better error recovery, including fewer crashes on badly formed PP input.
This commit is contained in:
parent
9cc81de096
commit
802c62bca4
8 changed files with 78 additions and 32 deletions
|
|
@ -1,7 +1,6 @@
|
|||
cppBad2.vert
|
||||
ERROR: 0:3: 'macro expansion' : End of input in macro b
|
||||
ERROR: 0:3: '' : compilation terminated
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
|
||||
|
||||
Shader version: 100
|
||||
|
|
|
|||
4
Test/baseResults/preprocessor.bad_arg.vert.err
Normal file
4
Test/baseResults/preprocessor.bad_arg.vert.err
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ERROR: 0:8: 'macro expansion' : End of input in macro EXP2
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
|
||||
|
||||
0
Test/baseResults/preprocessor.bad_arg.vert.out
Normal file
0
Test/baseResults/preprocessor.bad_arg.vert.out
Normal file
8
Test/preprocessor.bad_arg.vert
Executable file
8
Test/preprocessor.bad_arg.vert
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#define M(a) a
|
||||
int M(aou
|
||||
= 2) // Okay, one argument, split across newline
|
||||
;
|
||||
|
||||
// end of file during an argument
|
||||
#define EXP2(a, b)
|
||||
EXP2(((((1,2,3,4))), );
|
||||
Loading…
Add table
Add a link
Reference in a new issue