On 2/13/2012 7:16 AM, robin wrote:
The programming world is littered with "it can't happen" cases.
Everyone knows Murphy's Law ("If anything can go wrong, it will").
But not many have heard of Robert's Law? ("Even if it can't go wrong, it will".)

So, even it the length were tested prior, one can't assume that all
will be well when the EX is reached.
The MVC can be destructive, and the only case where it isn't is when
the destination is of length 256.

You know what they say about ASS-U-ME. For example, I have a
parsing routine that looks for variable names beginning with a
dollar sign. The code for this branch tests that the supplied
string is at least two bytes long, and not exceeding the
maximum. By the time I'm ready to execute the MVC, I know that
the BCTR will not result in a negative value. Q.E.D.

Gerhard Postpischil
Bradford, VT

Reply via email to