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

            Bug ID: 21737
           Summary: imprecise debug info for class initializer list
                    (hurting asan reports)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified

When we have a long initializer list the debug info seems to point to the
opening "{" instead of the actual code in the initializer list.

I frequently hit this when analyzing asan/msan/tsan reports. 
E.g. this: 

% cat init-list.cc 
struct Foo {
  Foo(int *p)
      : a(p[0])
      , b(p[1])
      , c(p[2])
      , d(p[3])
      , e(p[4])
      , f(p[5])
      , g(p[6])
      , h(p[7])
  {}

  int a, b, c, d, e, f, g, h;
};

int x[SIZE];

int main()  {
  Foo foo(x);
}

% clang -g -DSIZE=3 -fsanitize=address  init-list.cc && ./a.out 
=================================================================
==20464==ERROR: AddressSanitizer: global-buffer-overflow on address ...
    #0 0x499c91 in Foo::Foo(int*) init-list.cc:11:3


No matter what SIZE is, i.e. where the bug happens, asan will point to "{}"

-- 
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