Commit e8b54dec authored by Robert Bradshaw's avatar Robert Bradshaw

Set correct baseclass for heap allocated type subclasses.

parent cf75e9eb
......@@ -903,10 +903,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln(header)
base_type = type.base_type
if base_type:
basestruct_cname = base_type.objstruct_cname
if basestruct_cname == "PyTypeObject":
# User-defined subclasses of type are heap allocated.
basestruct_cname = "PyHeapTypeObject"
code.putln(
"%s%s %s;" % (
("struct ", "")[base_type.typedef_flag],
base_type.objstruct_cname,
basestruct_cname,
Naming.obj_base_cname))
else:
code.putln(
......
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