[LLVMdev] Win32 JIT issue + bug in ScheduleDAGSNodes.h?
Bill Wendling
isanbard at gmail.com
Wed Dec 31 17:13:20 PST 2008
On Dec 31, 2008, at 4:56 PM, srs wrote:
>> Okay. I wonder if we can modify it to check that the vector has
>> elements in it. Could you try this patch and let me know if it works
>> for you?
>>
>> -bw
>>
>> Index: include/llvm/CodeGen/ScheduleDAGSDNodes.h
>> ===================================================================
>> --- include/llvm/CodeGen/ScheduleDAGSDNodes.h (revision 61532)
>> +++ include/llvm/CodeGen/ScheduleDAGSDNodes.h (working copy)
>> @@ -103,10 +103,13 @@
>> ///
>> SUnit *NewSUnit(SDNode *N) {
>> #ifndef NDEBUG
>> - const SUnit *Addr = &SUnits[0];
>> + const SUnit *Addr = 0;
>> + if (SUnits.size() > 0)
>> + Addr = &SUnits[0];
>> #endif
>> SUnits.push_back(SUnit(N, (unsigned)SUnits.size()));
>> - assert(Addr == &SUnits[0] && "SUnits std::vector reallocated
>> on
>> the fly!");
>> + assert((Addr == 0 || Addr == &SUnits[0]) &&
>> + "SUnits std::vector reallocated on the fly!");
>> SUnits.back().OrigNode = &SUnits.back();
>> return &SUnits.back();
>> }
>>
>
> This works fine for me.
>
Cool! I'll submit it.
-bw
More information about the llvm-dev
mailing list