Test the object not the class duhhh
parent
37b11ce2e1
commit
1ff063d7de
|
@ -341,7 +341,7 @@ class Util
|
||||||
# See #unpack_pointer
|
# See #unpack_pointer
|
||||||
#
|
#
|
||||||
def is_null_pointer(pointer)
|
def is_null_pointer(pointer)
|
||||||
if pointer.class.kind_of? String
|
if pointer.kind_of? String
|
||||||
pointer = unpack_pointer(pointer)
|
pointer = unpack_pointer(pointer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ class Util
|
||||||
|
|
||||||
# Returns true if the type passed describes a data structure, false otherwise
|
# Returns true if the type passed describes a data structure, false otherwise
|
||||||
def is_struct_type?(type)
|
def is_struct_type?(type)
|
||||||
return type.class.kind_of? Array
|
return type.kind_of? Array
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ class Util
|
||||||
return pointer_size
|
return pointer_size
|
||||||
end
|
end
|
||||||
|
|
||||||
if type.class.kind_of? String
|
if type.kind_of? String
|
||||||
if is_array_type?(type)
|
if is_array_type?(type)
|
||||||
element_type, length = split_array_type(type)
|
element_type, length = split_array_type(type)
|
||||||
return length * sizeof_type(element_type)
|
return length * sizeof_type(element_type)
|
||||||
|
|
Loading…
Reference in New Issue