[llvm-bugs] [Bug 44497] New: Verifier allows pointer to void but is caught by IRReader

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 9 03:14:13 PST 2020


            Bug ID: 44497
           Summary: Verifier allows pointer to void but is caught by
           Product: libraries
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Bitcode Reader
          Assignee: unassignedbugs at nondot.org
          Reporter: vaivaswatha at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23002
  --> https://bugs.llvm.org/attachment.cgi?id=23002&action=edit
Toy program to produce and verify a simple function foo

The LLVM library allows generation of a function "i32 foo (void*)" that has a
"void*" argument, and the IR is successfully verified by the verifier. But the
IR parser (correctly) flags it as an error.

This bug should be in the IR category (but that doesn't exist), so I'm filing
it under IRReader

I've attached a toy program that produces and successfully (but incorrectly)
verifies a function with "void*" argument. It can be compiled as

"g++ -g llvm_void_ptr.cpp `llvm-config --cxxflags --ldflags --system-libs
--libs core` -std=c++14".

Upon running the produced executable, it produces, verifies and prints "foo"
(the function that takes a "void*" as argument. This emitted IR is however not
parsable by "opt". The verifier should check against this and flag an error.

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/20200109/b4c88c52/attachment-0001.html>

More information about the llvm-bugs mailing list