[LLVMbugs] [Bug 427] NEW: Assertion On V1 Bytecode Files

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Aug 23 08:41:35 PDT 2004


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=427

           Summary: Assertion On V1 Bytecode Files
           Product: libraries
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bytecode Reader
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rspencer at x10sys.com


In testing backwards compatibility with V1 bytecode files, there seems to be a
problem introduced by version 1.45 of Value.cpp:


diff -r1.44 -r1.45
33a34,36
>   if (!isa<Constant>(this) && !isa<BasicBlock>(this))
>     assert((Ty->isFirstClassType() || Ty == Type::VoidTy) &&
>            "Cannot create non-first-class values except for constants!");

revision 1.45
date: 2004/07/06 17:44:17;  author: lattner;  state: Exp;  lines: +3 -0
Find bugs sooner rather than later.  In this case, don't allow the
creation of instructions that don't have a first-class or void type.

This seems to have broken reading bytecode V1 files (but not subsequent
versions). The problem is that the reader uses an "Argument" Value as a
placeholder until it can get the actual value. Argument's constructor uses the
Value constructor in which this assert was placed. Since Argument is
neither first class nor void, and its not a constant nor a basic block,
it asserts and reading bytecode fails.

The problem occurs in only specific V1 bytecode files and I've only seen
it happen with a call instruction. The Bytecode reader processes an type/value
operand pair of the call, and asks for the Value of it. Since the value has not
yet been instantiated, the bcreader creates a placeholder Argument value and
then during construction of the Argument, it asserts.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list