[llvm-commits] [llvm] r59940 - in /llvm/trunk: docs/LangRef.html lib/Analysis/BasicAliasAnalysis.cpp
edwintorok at gmail.com
Sun Nov 23 23:47:21 PST 2008
On 2008-11-24 09:43, Nick Lewycky wrote:
> Török Edwin wrote:
>> On 2008-11-24 07:00, Nick Lewycky wrote:
>>> Author: nicholas
>>> Date: Sun Nov 23 23:00:44 2008
>>> New Revision: 59940
>>> URL: http://llvm.org/viewvc/llvm-project?rev=59940&view=rev
>>> Seriously strengthen the guarantee offered by noalias on a function's return
>>> value. It must now be as if the pointer were allocated and has not escaped to
>>> the caller. Thanks to Dan Gohman for pointing out the error in the original
>>> and helping devise this definition.
>> malloc(0) is allowed to return a unique pointer, instead of NULL.
>> Does this code handle that?
> Sure, a noalias function can return NULL or a unique pointer. Returning
> NULL is sufficient to not alias.
Agreed about NULL.
However if I call the function twice, and it returns the same pointer
(which is unique, but same for both calls), doesn't that mean
that the return value aliases a caller visible pointer?
More information about the llvm-commits