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
Kirill Smelkov
cython
Commits
457c0ee4
Commit
457c0ee4
authored
Aug 10, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler crash when manager.__enter__() call node in with statement gets replaced
parent
135dc33c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-1
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
457c0ee4
...
@@ -11312,11 +11312,14 @@ class ProxyNode(CoercionNode):
...
@@ -11312,11 +11312,14 @@ class ProxyNode(CoercionNode):
self
.
constant_result
=
arg
.
constant_result
self
.
constant_result
=
arg
.
constant_result
self
.
_proxy_type
()
self
.
_proxy_type
()
def
analyse_
expression
s
(
self
,
env
):
def
analyse_
type
s
(
self
,
env
):
self
.
arg
=
self
.
arg
.
analyse_expressions
(
env
)
self
.
arg
=
self
.
arg
.
analyse_expressions
(
env
)
self
.
_proxy_type
()
self
.
_proxy_type
()
return
self
return
self
def
infer_type
(
self
,
env
):
return
self
.
arg
.
infer_type
(
env
)
def
_proxy_type
(
self
):
def
_proxy_type
(
self
):
if
hasattr
(
self
.
arg
,
'type'
):
if
hasattr
(
self
.
arg
,
'type'
):
self
.
type
=
self
.
arg
.
type
self
.
type
=
self
.
arg
.
type
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
457c0ee4
...
@@ -1220,13 +1220,13 @@ class WithTransform(CythonTransform, SkipDeclarations):
...
@@ -1220,13 +1220,13 @@ class WithTransform(CythonTransform, SkipDeclarations):
self
.
visitchildren
(
node
,
'body'
)
self
.
visitchildren
(
node
,
'body'
)
pos
=
node
.
pos
pos
=
node
.
pos
body
,
target
,
manager
=
node
.
body
,
node
.
target
,
node
.
manager
body
,
target
,
manager
=
node
.
body
,
node
.
target
,
node
.
manager
node
.
enter_call
=
ExprNodes
.
SimpleCallNode
(
node
.
enter_call
=
ExprNodes
.
ProxyNode
(
ExprNodes
.
SimpleCallNode
(
pos
,
function
=
ExprNodes
.
AttributeNode
(
pos
,
function
=
ExprNodes
.
AttributeNode
(
pos
,
obj
=
ExprNodes
.
CloneNode
(
manager
),
pos
,
obj
=
ExprNodes
.
CloneNode
(
manager
),
attribute
=
EncodedString
(
'__enter__'
),
attribute
=
EncodedString
(
'__enter__'
),
is_special_lookup
=
True
),
is_special_lookup
=
True
),
args
=
[],
args
=
[],
is_temp
=
True
)
is_temp
=
True
)
)
if
target
is
not
None
:
if
target
is
not
None
:
body
=
Nodes
.
StatListNode
(
body
=
Nodes
.
StatListNode
(
pos
,
stats
=
[
pos
,
stats
=
[
...
...
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