[LLVMbugs] [Bug 4028] New: Iterating over all uses of a Function is buggy on Windows

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Apr 21 12:16:42 PDT 2009


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

           Summary: Iterating over all uses of a Function is buggy on
                    Windows
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bitcode Reader
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: foldr at codedgers.com
                CC: llvmbugs at cs.uiuc.edu, foldr at codedgers.com


Created an attachment (id=2845)
 --> (http://llvm.org/bugs/attachment.cgi?id=2845)
Test pass that exhibits this behaviour

[Copied from my message to llvm-dev]

I try to iterate over all uses of a Function with the following
code (simplified):

for (Value::use_iterator UI = F->use_begin(), UE = F->use_end();
                         UI != UE; ++UI) {

    if (CallInst* I = dyn_cast<CallInst>(*UI)) {
    // do something interesting
    }
}

This works on Linux, but on Windows the dyn_cast fails, even
though the only use of F in that module is a 'call'. However,
dyn_cast<Instruction>(*UI) works, and returns a pointer
to "<Invalid operator>" instruction.

[Addendum]

I wrote a small test pass that exhibits this behaviour, and also
manages to crash opt:

main
interesting_function
<Invalid operator>
This is not a CallInst!
Stack dump:
0.      Running pass 'Function Pass Manager' on module 'simple.bc'.
1.      Running pass 'Module Verifier' on function '@main'
0053AD15 (0x00564090 0x53E58955 0x0022F860 0x005F88ED)
0053AF59 (0x0022F860 0x00564090 0x53E58955 0x00000002)
0053AFC6 (0x0022F860 0x0081D430 0x0022F5EC 0x005BE860)
0053FA01 (0x0022F7D0 0x0081D430 0x0022F848 0x00540F67)
005D9158 (0x0022F7D0 0x0081D430 0x0022F7F0 0x00000000)
00540F67 (0x0081D430 0x0022F860 0x00000000 0x0060B559)
005412DF (0x0081D430 0x003F7CF4 0x00000000 0x00638943)
006733CC (0x003F7CF4 0x0081D430 0x0022F8D8 0x003F7CD0)
005D724D (0x003F7CD0 0x0081D430 0x0022F9B8 0x0054F512)
005D7356 (0x003F7CD0 0x0022F980 0x003F698C 0x0081D430)
0054F512 (0x003F7CD0 0x003F698C 0x0022FAC8 0x0054A6DD)
0054EB97 (0x003F7CD0 0x003F698C 0x0022FA48 0x005EC980)
005ECF0C (0x003F7CD0 0x003F698C 0x0022FA48 0x00691064)
005EC980 (0x003F7CD0 0x003F698C 0x003F7C28 0x003F7BD8)
00548D19 (0x003F7CD0 0x003F698C 0x0022FAC8 0x005E5B38)
005ECCF8 (0x003F7CD0 0x003F8F04 0x003F8E78 0x006103E9)
005EC701 (0x003F7CD0 0x003F8E78 0x0022FB08 0x00663D80)
005ECCA8 (0x003F7CD0 0x003F7BF8 0x003F7BF8 0x00536896)
005ECC59 (0x003F7CD0 0x003F7BD8 0x0022FB48 0x0062FBAD)
005D7530 (0x003F7CD0 0x003F7BD8 0x003F7BD8 0x00000004)
0053804F (0x003FBE68 0x003F7BD8 0x003F9318 0x003F7BD8)
005381DC (0x003FBE68 0x003F9340 0x003F9340 0x00000005)
00538407 (0x003F6C18 0x003F9340 0x0022FC58 0x00000000)
0053879C (0x003FAC80 0x003F9340 0x0022FF78 0x00404E2E)
005389EF (0x0022FE10 0x003F9340 0x008142FC 0x00000000)
00404E2E (0x00000003 0x003F2D20 0x003F30E8 0x00821004)
004010B6 (0x00000001 0x00000009 0x0022FFF0 0x7D4E7D42)
00401148 (0x00000000 0x00000000 0x7EFDE000 0xC0000005)
7D4E7D42 (0x00401130 0x00000000 0x00000000 0x00000000),
BaseProcessInitPostImport()+0141 bytes(s)
E:\code\codedgers\llvm\Debug\bin\opt.exe: could not open file


-- 
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