Rainer Deyke wrote:
Andrei Alexandrescu wrote:
Rainer Deyke wrote:
If the caller wasn't expecting the array to be modified, then that's a
textbook case of memory corruption.
[citation needed]
I guess we need to define memory corruption first. "Memory corruption
is when a piece of code erroneously overwrites memory."
Where's that quote from?
That definition is too vague to be of any use. Even an int that's
written with a value when the spec meant to write another value is
erroneously written and would be, by your definition, memory corruption.
It is not.
That applies
here. Do you have a better definition?
I do, but since you mentioned a textbook case of memory corruption, I
was curious which textbook that wold come from. That's why I asked for a
_citation_. A vague useless ad-hoc definition is easy to put together.
Andrei