effect of free()
Tom Neff
tneff at bfmny0.UU.NET
Fri Sep 8 23:45:02 AEST 1989
In article <10973 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <1010 at m3.mfci.UUCP> karzes at mfci.UUCP (Tom Karzes) writes:
>>Nonsense. There are no indirect or indexed references in the code above,
>>hence no opportunities for invalid address traps. Period.
>
>Loading an unmapped address descriptor into an address register may
>cause an exception on some reasonable architectures. Exclamation point.
For this to be true, NULL itself would have to be a "mapped address
descriptor" on those "reasonable architectures," or else you couldn't
even do the compare *before* the free() call. But if NULL is a mapped
address descriptor, it beats me how you're going to trap dereferences.
I would like to hear one real world example of an architecture where it
can be illegal to compare the VALUE of a pointer variable to 0 after
passing the CONTENTS of the variable to some OS routine. Also whether
there's a C compiler for that architecture. :-)
--
Annex Canada now! We need the room, \) Tom Neff
and who's going to stop us. (\ tneff at bfmny0.UU.NET
More information about the Comp.lang.c
mailing list