If you tried that memr expression in C (e.g., strcpy(...)) you would get a
crash. Sometimes higher level routines give special meaning to a 0 pointer
(usually that a default value is used) but lower level routines such as
strcpy and memr do not (what would the default value be?).
Treating 0 special out of all the values that can cause memr to crash is not
worthwhile. If the general problem of memr crashes became significant enough
it might warrant the work to catch all bad memory references and report an
error but this work is warranted at this time.
----- Original Message -----
From: "Raul Miller" <[EMAIL PROTECTED]>
To: "Beta forum" <[email protected]>
Sent: Wednesday, October 17, 2007 12:48 PM
Subject: Re: [Jbeta] j null pointer error
On 10/17/07, Roger Hui <[EMAIL PROTECTED]> wrote:
memr 1 0 _1 also crashes and in general memr addr,offset,_1
crashes for lots of different combinations of addr and offset.
Can't check for everything.
Yes, but 0 is special -- it's the null pointer. 1 on the other hand is
not a valid pointer value on any modern machine.
Don't you get addr and offset from somewhere? Perhaps they
should be checked at that point if you want to check them.
Sure -- in this case, I got it from glGetString, which always
returns either a valid string reference or a null pointer.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm