[LLVMbugs] [Bug 3651] New: cast_or_null for op_iterator *does* dereference NULL

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Feb 23 04:28:50 PST 2009


           Summary: cast_or_null for op_iterator *does* dereference NULL
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ggreif at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Using the type simplification mechanism with
cast_or_null<BasicBlock>(op_begin()) fails to check whether the dereferenced
op_begin() returns a non-null result before going on and doing the cast. This
is not the case when type simplification is not needed. I.e. this works:

I see two possible places where the bug hides:
1) in the type simplifier that deals with operand_iterator and friends
specifically, or
2) the generic mechanism of type simplification.

I'll try to look into both in the next days, but maybe someone more
knowledgeable comes in first.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list