projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf75e9e
)
Set correct baseclass for heap allocated type subclasses.
author
Robert Bradshaw
<robertwb@gmail.com>
Thu, 12 Sep 2013 20:59:51 +0000
(13:59 -0700)
committer
Robert Bradshaw
<robertwb@gmail.com>
Thu, 12 Sep 2013 20:59:51 +0000
(13:59 -0700)
Cython/Compiler/ModuleNode.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ModuleNode.py
b/Cython/Compiler/ModuleNode.py
index
399f07a
..
bc2ff51
100644
(file)
--- a/
Cython/Compiler/ModuleNode.py
+++ b/
Cython/Compiler/ModuleNode.py
@@
-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.obj
struct_cname,
+ basestruct_cname,
Naming.obj_base_cname))
else:
code.putln(