Mail Archives: djgpp/2001/06/30/09:44:59
> From: invalid AT erehwon DOT invalid (Graaagh the Mighty)
> Newsgroups: comp.os.msdos.djgpp
> Date: Sat, 30 Jun 2001 09:24:56 GMT
>
> On Fri, 29 Jun 2001 0:56:41, "Charles Sandmann"
> <sandmann AT clio DOT rice DOT edu> sat on a tribble, which squeaked:
>
> >This won't catch huge overruns, but if you write-protect the entire text
> >section you will at least prevent overwrite of executable code and catch
> >errors sooner with correct error messages.
>
> For non-self-modifying-code (and self-modifying is rare these days --
> self-modifying algorithms work best by using function pointers or ints
> and switch statements) this should work.
The limitation Charles mentioned has nothing to do with self-modifying
code. What Charles told you is that if you have a very large
off-stack allocation, like if you have a large automatic array or
structure, or even a simple alloca(1000000), the separate stack
segment won't detect it.
- Raw text -