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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
51d1bd1c
Commit
51d1bd1c
authored
Oct 15, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #245, crash on cimported struct -> object.
parent
4d4d29d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+3
-2
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-0
tests/run/crashT245.h
tests/run/crashT245.h
+1
-1
tests/run/crashT245.pyx
tests/run/crashT245.pyx
+3
-3
No files found.
Cython/Compiler/PyrexTypes.py
View file @
51d1bd1c
...
@@ -1535,6 +1535,8 @@ class CStructOrUnionType(CType):
...
@@ -1535,6 +1535,8 @@ class CStructOrUnionType(CType):
# typedef_flag boolean
# typedef_flag boolean
# packed boolean
# packed boolean
# entry Entry
is_struct_or_union
=
1
is_struct_or_union
=
1
has_attributes
=
1
has_attributes
=
1
...
@@ -1563,8 +1565,7 @@ class CStructOrUnionType(CType):
...
@@ -1563,8 +1565,7 @@ class CStructOrUnionType(CType):
self
.
to_py_function
=
None
self
.
to_py_function
=
None
self
.
_convert_code
=
False
self
.
_convert_code
=
False
return
False
return
False
entry
=
env
.
lookup
(
self
.
name
)
forward_decl
=
(
self
.
entry
.
visibility
!=
'extern'
)
forward_decl
=
(
entry
.
visibility
!=
'extern'
)
self
.
_convert_code
=
StructUtilityCode
(
self
,
forward_decl
)
self
.
_convert_code
=
StructUtilityCode
(
self
,
forward_decl
)
env
.
use_utility_code
(
self
.
_convert_code
)
env
.
use_utility_code
(
self
.
_convert_code
)
...
...
Cython/Compiler/Symtab.py
View file @
51d1bd1c
...
@@ -363,6 +363,7 @@ class Scope(object):
...
@@ -363,6 +363,7 @@ class Scope(object):
entry = self.declare_type(name, type, pos, cname,
entry = self.declare_type(name, type, pos, cname,
visibility = visibility, defining = scope is not None)
visibility = visibility, defining = scope is not None)
self.sue_entries.append(entry)
self.sue_entries.append(entry)
type.entry = entry
else:
else:
if not (entry.is_type and entry.type.is_struct_or_union
if not (entry.is_type and entry.type.is_struct_or_union
and entry.type.kind == kind):
and entry.type.kind == kind):
...
...
tests/run/crashT245.h
View file @
51d1bd1c
typedef
struct
{
typedef
struct
{
int
x
int
x
;
}
MyStruct
;
}
MyStruct
;
tests/run/crashT245.pyx
View file @
51d1bd1c
cimport
crashT245_pxd
__doc__
=
"""
"""
>>> f()
>>> f()
{'x': 1}
{'x': 1}
"""
"""
cimport
crashT245_pxd
def
f
():
def
f
():
cdef
crashT245_pxd
.
MyStruct
s
cdef
crashT245_pxd
.
MyStruct
s
s
.
x
=
1
s
.
x
=
1
...
...
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