effect of free()
Charles Marslett
chasm at attctc.Dallas.TX.US
Sat Sep 9 13:04:57 AEST 1989
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 at attctc.dallas.tx.us
More information about the Comp.lang.c
mailing list