ANSI C, hardware protection, out-of-bounds pointers
Karl Botts
kdb at chinet.chi.il.us
Fri Sep 15 12:53:02 AEST 1989
>Even in such cases, it still wouldn't help with arrays of large objects,
>because first-1 would point many bytes below the start of the allocated
>data block.
No argument. I think I said something about the size of the objects in my
original message.
>Just don't use first-1. It's not that hard to avoid.
No argument again -- I would never do it myself. It has been done,
however. Take a look at yyparse.c the way it handles the stack pointers (I
think they are called "yyvs" and "yypvs" or something like that.) I don't
have a machine where meerly mentioning, as opposed to dereferencing, an OOB
pointer will cause an exception, but such machines exist and I suspect that
YACC parsers would fail under certain circumstances on such machines. I'm
out on a bit of a limb here, but I'd be interested if anybody has had such
an experience?
More information about the Comp.std.c
mailing list