FFI needs NullPointerError exception class
------------------------------------------

                 Key: JRUBY-4128
                 URL: http://jira.codehaus.org/browse/JRUBY-4128
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.3.1
            Reporter: John Croisant
            Assignee: Thomas E Enebo
            Priority: Minor


For compatibility with Ruby-FFI, JRuby's FFI implementation should have a new 
exception class, FFI::NullPointerError, which should be raised when the user 
attempts to read or write from a null pointer (i.e. a pointer with address 0).

Here are some examples which should raise FFI::NullPointerError, but currently 
raise RuntimeError:

{noformat}
FFI::Pointer.new(0).get_int(0)

FFI::Pointer.new(0).write_long(123)

Class.new( FFI::Struct ){ layout :a, :string }.new( FFI::Pointer.new(0) )[:a]

Class.new( FFI::Struct ){ layout :a, :double }.new( FFI::Pointer.new(0) )[:a] = 
12.345
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to