Skip to content

mangled parameters or return values #31

@patrickhno

Description

@patrickhno

On OSX objc_allocateClassPair parameters or return value gets mangled somehow.
The last output line of this example should be "Test" and not a blank string ""

obj = CFunc::call(CFunc::Pointer, "objc_getClass", 'NSObject')
v = CFunc::Int.new
v.value = 0
klass = CFunc::call(CFunc::Pointer, "objc_allocateClassPair", obj, 'Test', v)
name = CFunc::call(CFunc::Pointer, "class_getName", obj)
puts name.to_s.inspect  # => "NSObject"
name = CFunc::call(CFunc::Pointer, "class_getName", klass)
puts name.to_s.inspect  # => ""

Both ffi library itself using c and ruby ffi behaves as expected with the exact same sequence of calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions