Hi,
The compiler crashed with the following test program:
/* test.c
- To reproduce:
- $ clang -c -g -fstack-protector-strong test.c
- (fatal error: error in backend: Broken function found, compilation aborted!)
- (need an assertion-enabled build of the compiler) */
void __stack_chk_fail(void) { return; }
void foo() {
char bar[5];
}
/* end of test.c */
This is not a legitimate input C file because __stack_chk_fail is a reserved function name.
On the other hand, it seems that the compiler should be able to give a nicer diagnostic or
otherwise fail more gracefully instead of having to crash on invalid input (in the spirit of all
"internal compiler error"s are compiler bugs).
The proposed patch here attempts to add artificial debug information when the compiler
generates the call to __stack_chk_fail. Does this look like a reasonable thing to do?
Many thanks in advance,
- Gao