[llvm-bugs] [Bug 37207] New: msan: incorrect variable names for vla

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 23 00:52:13 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37207

            Bug ID: 37207
           Summary: msan: incorrect variable names for vla
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: dvyukov at google.com
                CC: llvm-bugs at lists.llvm.org

#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'.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180423/0a3d1f51/attachment.html>


More information about the llvm-bugs mailing list