5 ms·
I have accidentally discovered a bug in Clang that causes the compiler generate millions of consecutive "addq $2147483647, %rsp" instructions and it wouldn't te
by bluetomcat 10y ago
I have accidentally discovered a bug in Clang that causes the compiler generate millions of consecutive "addq $2147483647, %rsp" instructions and it wouldn't terminate maybe in hours (it could probably be an infinite loop, I haven't seen it terminate):
$ clang --version
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.4.0
...
$ cat test.c
#include <stdint.h>
int main(void) {
int x[SIZE_MAX / 31];
return 0;
}
$ clang test.c
test.c:5:11: error: array is too large (595056260442243600 elements)
int x[SIZE_MAX / 31];
$ cat test-2.c
#include <stdint.h>
int main(void) {
int x[SIZE_MAX / 32];
return 0;
}
$ clang test-2.c
... Keep waiting :-) ...