http://llvm.org/bugs/show_bug.cgi?id=3651

           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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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:
cast_or_null<BasicBlock>(op_begin()->get()).

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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to