[PATCH] D16771: [ELF] PHDRS linker script command implemented.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 07:27:58 PST 2016


grimar added a comment.

In http://reviews.llvm.org/D16771#355621, @rafael wrote:

> > > > Do not return an undefined value.
>
> > 
>
> > >  That was done intentionally. My point was that using of the return value in case of error is also a error (at least for that method), error flag should be checked, value can be accessedm but should not be used in any results because of invalid nature. Undefined value accepts to this requirements.
>
> > 
>
> > >  When you look the value of undefined variable it is usually clear it is the one, but defining it to something can hide the actual error.
>
> > 
>
> > 
>
> > Returning an undefined variable is an undefined behavior, no?
>
>
> Failing to return is. Not sure about returning an uninitialized
>  variable, but it does look odd.
>
> Cheers,
> Rafael


That will be fixed. It is really UB, I missed that.


http://reviews.llvm.org/D16771





More information about the llvm-commits mailing list