NotNull pointers
Brad Roberts
braddr at puremagic.com
Wed Aug 31 00:11:43 PDT 2011
On Wednesday, August 31, 2011 12:06:57 AM, Iain Buclaw wrote:
> == Quote from Brad Roberts (braddr at puremagic.com)'s article
>> On 8/30/2011 10:35 PM, Walter Bright wrote:
>>> On 8/30/2011 6:28 PM, Brad Roberts wrote:
>>>> On Tue, 30 Aug 2011, Walter Bright wrote:
>>>>
>>>>> On 8/30/2011 5:08 PM, Bernard Helyer wrote:
>>>>>> On Tue, 30 Aug 2011 16:19:00 -0700, Walter Bright wrote:
>>>>>>
>>>>>>> Looking for corruption of the data.
>>>>>>
>>>>>> Why doesn't it check for null, and pass if no invariant is defined?
>>>>>
>>>>> Because the hardware does the null check for you, which is what a seg fault
>>>>> is.
>>>>
>>>> The frequency with which this comes up and the lack of converts to that
>>>> point of view ought to tell you something here. :)
>>>
>>> I am simply baffled by it.
>>>
>>>
>>>> Would you entertain a pull request with this fairly simple change?
>>>
>>> It'll add a lot of bloat.
>> Well, for those that would like it.. yebblies created a pull request with the
> approp
riate changes:
>> https://github.com/D-Programming-Language/dmd/pull/358
>> (I haven't tried it myself.)
>> Later,
>> Brad
>
> You should be able to do it with less changes than that. :~)
>
> In GDC I settled with assert(e1 != null ? e1.invariant() : _d_assert(...))
>
> I agree, it can be a bit of a nuance if code were to ICE in the runtime library
> and it takes away several minutes just to find that and pinpoint the source of the
> problems.
>
> Regards
I didn't look at the impl, just the existence. Please comment on the
pull request.
More information about the Digitalmars-d
mailing list