http://llvm.org/bugs/show_bug.cgi?id=17068

            Bug ID: 17068
           Summary: [MSan] Failed to catch conditional move?
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Not sure if this is an msan bug or not, but I feel like it should have caught
this:

% cat msan/bug.cpp 
int main() {
  int x;
  int *volatile p = &x;
  return *p ? 0 : 1;
}

% ~/bin/clang++ -o msan_bug -std=c++11 -g -fsanitize=memory msan/bug.cpp
% ./msan_bug

The program exits with status 1.


However, this equivalent program produces a lovely msan report:
% cat msan/bug.cpp 
int main() {
  int x;
  int *volatile p = &x;
  if (*p)
    return 0;
  return 1;
}
% ~/bin/clang++ -o msan_bug -std=c++11 -g -fsanitize=memory msan/bug.cpp
% ./msan_bug                                                                    
==20078== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f42598d1518
(/home/chandlerc/src/llvm.git/build/gn_2013/msan_bug+0x2f518)
    #1 0x7f42589e160c (/lib64/libc.so.6+0x2460c)
    #2 0x7f42598d12b0
(/home/chandlerc/src/llvm.git/build/gn_2013/msan_bug+0x2f2b0)
Exiting

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to