Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!aplcen!ginosko!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.lang.c Subject: Re: effect of free() Message-ID: <14636@bfmny0.UU.NET> Date: 8 Sep 89 13:45:02 GMT References: <319@cubmol.BIO.COLUMBIA.EDU> <3756@buengc.BU.EDU> <1989Aug17.005548.745@twwells.com> <16022@vail.ICO.ISC.COM> <248@seti.inria.fr> <1010@m3.mfci.UUCP> <10973@smoke.BRL.MIL> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Organization: ^ Lines: 20 In article <10973@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <1010@m3.mfci.UUCP> karzes@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@bfmny0.UU.NET