Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
279e68ea
Commit
279e68ea
authored
Apr 08, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bad core generation for ctypedef classes when init tp_weaklistoffset type slot
parent
76e9534b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-2
tests/bugs/weakref_T276.pyx
tests/bugs/weakref_T276.pyx
+12
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
279e68ea
...
...
@@ -1959,10 +1959,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
weakref_entry
:
if
weakref_entry
.
type
is
py_object_type
:
tp_weaklistoffset
=
"%s.tp_weaklistoffset"
%
typeobj_cname
code
.
putln
(
"if (%s == 0) %s = offsetof(struct %s, %s);"
%
(
if
type
.
typedef_flag
:
objstruct
=
type
.
objstruct_cname
else
:
objstruct
=
"struct %s"
%
type
.
objstruct_cname
code
.
putln
(
"if (%s == 0) %s = offsetof(%s, %s);"
%
(
tp_weaklistoffset
,
tp_weaklistoffset
,
type
.
objstruct_cname
,
objstruct
,
weakref_entry
.
cname
))
else
:
error
(
weakref_entry
.
pos
,
"__weakref__ slot must be of type 'object'"
)
...
...
tests/bugs/weakref_T276.pyx
0 → 100644
View file @
279e68ea
__doc__
=
u"""
"""
cdef
class
A
:
cdef
__weakref__
ctypedef
public
class
B
[
type
B_Type
,
object
BObject
]:
cdef
__weakref__
cdef
public
class
C
[
type
C_Type
,
object
CObject
]:
cdef
__weakref__
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment