Commit 1084fafb authored by Robert Bradshaw's avatar Robert Bradshaw

Set correct baseclass for heap allocated type subclasses.

--HG--
extra : transplant_source : E%BEhL%948%C1%07%EC%BDx%7C%7E%C2%3Fq%1D%EFE%BC
parent 8d1c6b5e
......@@ -916,10 +916,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