Open
Description
Just compile
int main(int argc, char **argv) {
int x = -1;
int arr[x];
return 0;
}
with
clang -fsanitize=vla-bound -ftrivial-auto-var-init=zero
or with
clang -fsanitize=vla-bound -ftrivial-auto-var-init=pattern
Run the executable and see that UBSan rt catches segfault:
UndefinedBehaviorSanitizer:DEADLYSIGNAL
.
With
clang -fsanitize=vla-bound -ftrivial-auto-var-init=uninitialized
UBSan works fine and the process terminates with zero exit-code.
Observed in clang-17.0.6 and clang-18.1.3.
OSes: Ubuntu-24.04 and ArchLinux.