llvm-project
llvm-project copied to clipboard
msan: incorrect variable names for vla
| Bugzilla Link | 37207 |
| Version | unspecified |
| OS | Linux |
| CC | @dwblaikie,@eugenis,@ramosian-glider,@kcc,@vitalybuka |
Extended Description
#include <stdio.h>
int main() { volatile int x = 10; volatile char y[x]; if (y[5]) printf("here\n"); return 0; }
$ clang -v clang version 7.0.0 (trunk 326052) $ clang test.c -fsanitize=memory -fsanitize-memory-track-origins -g $ ./a.out
==260809==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x499e02 in main test.c:7:6
Uninitialized value was created by an allocation of 'vla' in the stack frame of function 'main' #0 0x499b10 in main test.c:4
SUMMARY: MemorySanitizer: use-of-uninitialized-value /tmp/test1.c:7:6 in main
The variable is called 'y', not 'vla'.