Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!attctc!chasm From: chasm@attctc.Dallas.TX.US (Charles Marslett) Newsgroups: comp.lang.c Subject: Re: effect of free() Summary: Reprise -- register varibles Message-ID: <9279@attctc.Dallas.TX.US> Date: 9 Sep 89 03:04:57 GMT References: <319@cubmol.BIO.COLUMBIA.EDU> <3756@buengc.BU.EDU> <14636@bfmny0.UU.NET> Organization: The Unix(R) Connection, Dallas, Texas Lines: 24 Now that we have seen code that can really generate a trap on (most) invalid segments, and could have been generated by a (very bad) compiler, another point has been raised: what about register variables? If Chris Torek's pointer, passed to free(), were a register variable, and presumably saved on the stack when the system routine free() was called, it will be reloaded when the calling routine is resumed. This would be a VERY-BAD-THING! And probably non-standard. I think the probability of a standard-conforming compiler generating a trap here, and not generating a trap under all legal conditions, is approaching NULL ;^). Of course, segment registers need not be used to hold register pointers, but it makes more sense than using them as paths to the ALU. Charles =========================================================================== Charles Marslett STB Systems, Inc. <== Apply all standard disclaimers Wordmark Systems <== No disclaimers required -- that's just me chasm@attctc.dallas.tx.us