Commit 53f51bae authored by Robert Bradshaw's avatar Robert Bradshaw

Dissallow python conversion to empty structs.

parent 0284b614
...@@ -3187,6 +3187,11 @@ class CStructOrUnionType(CType): ...@@ -3187,6 +3187,11 @@ class CStructOrUnionType(CType):
return None # tri-state-ish return None # tri-state-ish
if self._convert_from_py_code is None: if self._convert_from_py_code is None:
if not self.scope.var_entries:
# There are obviously missing fields; don't allow instantiation
# where absolutely no content is provided.
return False
for member in self.scope.var_entries: for member in self.scope.var_entries:
if not member.type.create_from_py_utility_code(env): if not member.type.create_from_py_utility_code(env):
self.from_py_function = None self.from_py_function = None
......
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