At 1:24 AM +0000 3/12/02, Alex Gough wrote:
>On Mon, 11 Mar 2002, Simon Glover wrote:
>
>>
>>   For more fun in the same vein, try this:
>>
>>    length S0
>>    end
>>
>>   In both cases the problem is that we're not checking the STRING*
>  >  pointer passed to the function before we start trying to dereference it.
>
>I seem to remember someone unpatching a couple of if (NULL == string)
>statements recently.  I'll be blunt and say: DON'T DO THAT.  Defensive
>programming is good, segfaulting is bad, remember?

There's no checking on purpose. We're assuming that the interpreter's 
internal state is consistent, and that the code compilers emit is 
correct.

The Safe-mode interpreter can and will check both S and P registers 
for correctness in the opcode functions, but the base interpreter can 
skip it.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to