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

            Bug ID: 50741
           Summary: Crash in APInt triggered by commit ce44fe199bbf
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

abhinavgaba noted that commit ce44fe199bbf triggers an assertion failure in
APInt for a very specific case of void pointer math.  Reproducer is simple:  

  $ cat test.c
  void a() {
    (void *)0 + 0xdead000000000000UL;
  }

  $ clang -cc1  -triple i386-pc-linux test.c
  clang: /localdisk2/gabaabhi/ics/l1/llvm/llvm/lib/Support/APInt.cpp:1609: 
llvm::APInt llvm::APInt::udiv(const llvm::APInt&) const: Assertion `RHS.U.VAL
!= 0 && "Divide by zero?"' failed.
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
  Stack dump:
  0.      Program arguments: clang -cc1 -triple i386-pc-linux test.c
  1.      test.c:2:35: current parser token ';'
  2.      test.c:1:10: parsing function body 'a'
  3.      test.c:1:10: in compound statement ('{}')
  ...

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

Reply via email to