Commit cf77721a authored by Brice Videau's avatar Brice Videau
Browse files

Check to avoid creating struct on zero size pointer.

parent 265d8247
......@@ -21,7 +21,7 @@ meta_parameter_lambda = lambda { |m, dir|
elsif $all_bitfield_names.include?(t.name)
"s << \"#{name}: [ \#{ZE::#{to_class_name(t.name)}.from_native(defi[\"#{name}\"], nil).join(\", \")} ]\""
elsif $all_struct_names.include?(t.name)
"s << \"#{name}: \#{ZE::#{to_class_name(t.name)}.new(FFI::MemoryPointer.from_string(defi[\"#{name}\"]))}\""
"s << \"#{name}: \#{defi[\"#{name}\"].size > 0 ? ZE::#{to_class_name(t.name)}.new(FFI::MemoryPointer.from_string(defi[\"#{name}\"])) : nil}\""
else
"s << \"#{name}: \#{defi[\"#{name}\"]}\""
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment