[llvm] r241345 - Avoid a use after free.

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Jul 3 16:29:55 PDT 2015


Ah, thanks.

> On 2015-Jul-03, at 14:54, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> 
> It was triggered by PR23310.bc.
> 
> Cheers,
> Rafael
> 
> 
> On 3 July 2015 at 13:08, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>> 
>>> On 2015-Jul-03, at 05:20, Rafael Espindola <rafael.espindola at gmail.com> wrote:
>>> 
>>> Author: rafael
>>> Date: Fri Jul  3 07:20:34 2015
>>> New Revision: 241345
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=241345&view=rev
>>> Log:
>>> Avoid a use after free.
>> 
>> Was this triggered by an in-tree testcase, or should we add one?
>> 
>> (If you don't think a testcase would be stable, maybe a comment?)
>> 
>>> 
>>> Modified:
>>>   llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
>>> 
>>> Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=241345&r1=241344&r2=241345&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
>>> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Fri Jul  3 07:20:34 2015
>>> @@ -4459,7 +4459,10 @@ std::error_code BitcodeReader::materiali
>>>  // Upgrade any old intrinsic calls in the function.
>>>  for (auto &I : UpgradedIntrinsics) {
>>>    if (I.first != I.second) {
>>> -      for (auto *U : I.first->users()) {
>>> +      for (auto UI = I.first->user_begin(), UE = I.first->user_end();
>>> +           UI != UE;) {
>>> +        User *U = *UI;
>>> +        ++UI;
>>>        if (CallInst *CI = dyn_cast<CallInst>(U))
>>>          UpgradeIntrinsicCall(CI, I.second);
>>>      }
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 





More information about the llvm-commits mailing list