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

            Bug ID: 30639
           Summary: CGDebugInfo Null dereference with OpenMP array access
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Reproducer:
void fobj_offset(int n) {
  int i;
  int cen[n];
  #pragma omp parallel for 
  for (i=0; i<n; i++) {
    cen[i]=i;
  }
}

clang -c -fopenmp -g repro.cpp

Running the above results in a crash as a result of CGDebugInfo::CreateType. 
On CGDebugInfo.cpp:2184, VAT->getSizeExpr() is NULL, thus EvaluateAsInt causes
a seg fault when it dereferences "this".

This error was introduced in R279445.

I've prepared a patch, so putting under review right after this gets posted.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to