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

            Bug ID: 33430
           Summary: [ubsan] false negative: pointer overflow check misses
                    subtractions with unsigned offsets
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: v...@apple.com
                CC: llvm-bugs@lists.llvm.org

This has been a problem with the pointer overflow check since it was introduced
in r304459.

An example from Eli: "p - SIZE_MAX" gets converted into (gep p 0 1), so
EmitCheckedInBoundsGEP expects the result of the gep to be "greater than" p.
This is wrong.

We should always expect "ptrtoint(p - <unsigned>) <= ptrtoint(p)".

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

Reply via email to