Displaying 11 results from an estimated 11 matches for "llvm_attribute_returns_nonnul".
Did you mean:
llvm_attribute_returns_nonnull
2016 Mar 23
4
UBSan, StringRef and Allocator.h
...PtrAllocator. The BumpPtrAllocator happened to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore returns nullptr from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
To put this in code, if I have
BumpPtrAllocator allocator;
StringRef s;
s.copy(allocator);
then i’m going to allocate 0 bytes in the allocator and get a StringRef(nullptr, 0). Its a valid StringRef, but an UBSan failur...
2016 Mar 23
3
UBSan, StringRef and Allocator.h
...PtrAllocator. The BumpPtrAllocator happened to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore returns nullptr from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
>
> To put this in code, if I have
>
> BumpPtrAllocator allocator;
> StringRef s;
> s.copy(allocator);
>
> then i’m going to allocate 0 bytes in the allocator and get a StringRef(nullptr, 0). It...
2016 Mar 23
0
UBSan, StringRef and Allocator.h
...rAllocator
> happened to not have anything allocated yet so the CurPtr is nullptr, but
> given that we need 0 space we think we have enough space and return an
> allocation of size 0 at address nullptr. This therefore returns nullptr
> from Allocate, but that method is marked
> with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS,
> both of which aren’t true in this case.
>
> To put this in code, if I have
>
> BumpPtrAllocator allocator;
> StringRef s;
> s.copy(allocator);
>
>
> then i’m going to allocate 0 bytes in the allocator and get a
> StringRef(null...
2016 Mar 23
0
UBSan, StringRef and Allocator.h
...umpPtrAllocator
> happened to not have anything allocated yet so the CurPtr is nullptr, but
> given that we need 0 space we think we have enough space and return an
> allocation of size 0 at address nullptr. This therefore returns nullptr
> from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL
> and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
Why is noalias not valid here?
I thought LLVM's notion of noalias was based on data dependence --
ptr_a does not alias ptr_b if a store to ptr_a does not have a data
dependence with a load from ptr_b and vice ve...
2016 Mar 23
0
UBSan, StringRef and Allocator.h
...PtrAllocator. The BumpPtrAllocator happened to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore returns nullptr from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
>>
>> To put this in code, if I have
>>
>> BumpPtrAllocator allocator;
>> StringRef s;
>> s.copy(allocator);
>>
>> then i’m going to allocate 0 bytes in the allocator and...
2016 Mar 28
2
UBSan, StringRef and Allocator.h
...happened to not have anything allocated yet so the CurPtr
>> is nullptr, but given that we need 0 space we think we have enough space
>> and return an allocation of size 0 at address nullptr. This therefore
>> returns nullptr from Allocate, but that method is marked
>> with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS,
>> both of which aren’t true in this case.
>>
>> To put this in code, if I have
>>
>> BumpPtrAllocator allocator;
>> StringRef s;
>> s.copy(allocator);
>>
>>
>> then i’m going to allocate 0 bytes in the...
2016 Mar 29
0
UBSan, StringRef and Allocator.h
...PtrAllocator. The BumpPtrAllocator happened to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore returns nullptr from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
>>>
>>> To put this in code, if I have
>>>
>>> BumpPtrAllocator allocator;
>>> StringRef s;
>>> s.copy(allocator);
>>>
>>> then i’m going to alloca...
2016 Mar 29
2
UBSan, StringRef and Allocator.h
...PtrAllocator. The BumpPtrAllocator happened to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore returns nullptr from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
>>>>
>>>> To put this in code, if I have
>>>>
>>>> BumpPtrAllocator allocator;
>>>> StringRef s;
>>>> s.copy(allocator);
>>>>
>>&...
2016 Mar 23
1
UBSan, StringRef and Allocator.h
...>> happened to not have anything allocated yet so the CurPtr is nullptr, but
>> given that we need 0 space we think we have enough space and return an
>> allocation of size 0 at address nullptr. This therefore returns nullptr
>> from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL
>> and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
>
> Why is noalias not valid here?
>
> I thought LLVM's notion of noalias was based on data dependence --
> ptr_a does not alias ptr_b if a store to ptr_a does not have a data
> dependence...
2016 Mar 29
0
UBSan, StringRef and Allocator.h
...t;>>> given that we need 0 space we think we have enough space
>>>>> and return an allocation of size 0 at address nullptr.
>>>>> This therefore returns nullptr from Allocate, but that
>>>>> method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL
>>>>> and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t
>>>>> true in this case.
>>>>>
>>>>> To put this in code, if I have
>>>>>
>>>>> BumpPtrAllocator allocator;
&...
2016 Mar 30
1
UBSan, StringRef and Allocator.h
...to not have anything allocated yet so the CurPtr is nullptr, but given that we need 0 space we think we have enough space and return an allocation of size 0 at address nullptr. This therefore returns nullptr from Allocate, but that method is marked with LLVM_ATTRIBUTE_RETURNS_NONNULL and LLVM_ATTRIBUTE_RETURNS_NOALIAS, both of which aren’t true in this case.
>>>>>>
>>>>>> To put this in code, if I have
>>>>>>
>>>>>> BumpPtrAllocator allocator;
>>>>>> StringRef s;
>>>>>>...