projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1edfca7
)
resolved strict aliasing problem by changing type cast
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 12 Jun 2008 14:41:41 +0000
(16:41 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 12 Jun 2008 14:41:41 +0000
(16:41 +0200)
Cython/Compiler/ModuleNode.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ModuleNode.py
b/Cython/Compiler/ModuleNode.py
index 40e31ca9de3d3e1aa0084f3086d552735008cb76..1bc6f3fe3bd956d6dac1ba6d06f71bd633c7a2e7 100644
(file)
--- a/
Cython/Compiler/ModuleNode.py
+++ b/
Cython/Compiler/ModuleNode.py
@@
-821,10
+821,13
@@
class ModuleNode(Nodes.Node, Nodes.BlockNode):
#if need_self_cast:
# self.generate_self_cast(scope, code)
if type.vtabslot_cname:
- code.putln("*(struct %s **)&p->%s = %s;" % (
- type.vtabstruct_cname,
+ if base_type:
+ struct_type_cast = "(struct %s*)" % base_type.vtabstruct_cname
+ else:
+ struct_type_cast = ""
+ code.putln("p->%s = %s%s;" % (
type.vtabslot_cname,
- type.vtabptr_cname))
+
struct_type_cast,
type.vtabptr_cname))
for entry in py_attrs:
if entry.name == "__weakref__":
code.putln("p->%s = 0;" % entry.cname)