[llvm-bugs] [Bug 33430] New: [ubsan] false negative: pointer overflow check misses subtractions with unsigned offsets

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 12 15:05:00 PDT 2017


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: unassignedclangbugs at nondot.org
          Reporter: vsk at apple.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170612/85c3310d/attachment-0001.html>


More information about the llvm-bugs mailing list