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
db0458d5
Commit
db0458d5
authored
Jun 07, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix large integer literal inference.
parent
1cfad096
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
Cython/Compiler/TypeInference.py
Cython/Compiler/TypeInference.py
+20
-1
No files found.
Cython/Compiler/TypeInference.py
View file @
db0458d5
...
...
@@ -3,6 +3,7 @@ import ExprNodes
import
Nodes
import
Builtin
import
PyrexTypes
from
Cython
import
Utils
from
PyrexTypes
import
py_object_type
,
unspecified_type
from
Visitor
import
CythonTransform
...
...
@@ -176,6 +177,24 @@ class MarkOverflowingArithmetic(CythonTransform):
visit_Node
=
visit_safe_node
def
visit_assignment
(
self
,
lhs
,
rhs
):
if
(
isinstance
(
rhs
,
ExprNodes
.
IntNode
)
and
isinstance
(
lhs
,
ExprNodes
.
NameNode
)
and
Utils
.
long_literal
(
rhs
.
value
)):
entry
=
lhs
.
entry
or
self
.
env
.
lookup
(
lhs
.
name
)
if
entry
:
entry
.
might_overflow
=
True
def
visit_SingleAssignmentNode
(
self
,
node
):
self
.
visit_assignment
(
node
.
lhs
,
node
.
rhs
)
self
.
visitchildren
(
node
)
return
node
def
visit_CascadedAssignmentNode
(
self
,
node
):
for
lhs
in
node
.
lhs_list
:
self
.
visit_assignment
(
lhs
,
node
.
rhs
)
self
.
visitchildren
(
node
)
return
node
class
PyObjectTypeInferer
:
"""
...
...
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