Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
2ae61c64
Commit
2ae61c64
authored
Oct 28, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some liveness-analysis bugs
parent
b887bc87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/analysis/function_analysis.cpp
src/analysis/function_analysis.cpp
+11
-3
src/core/ast.cpp
src/core/ast.cpp
+2
-0
No files found.
src/analysis/function_analysis.cpp
View file @
2ae61c64
...
@@ -105,11 +105,18 @@ public:
...
@@ -105,11 +105,18 @@ public:
bool
visit_classdef
(
AST_ClassDef
*
node
)
{
bool
visit_classdef
(
AST_ClassDef
*
node
)
{
_doStore
(
node
->
name
);
_doStore
(
node
->
name
);
for
(
auto
e
:
node
->
bases
)
e
->
accept
(
this
);
for
(
auto
e
:
node
->
decorator_list
)
e
->
accept
(
this
);
return
true
;
return
true
;
}
}
bool
visit_functiondef
(
AST_FunctionDef
*
node
)
{
bool
visit_functiondef
(
AST_FunctionDef
*
node
)
{
for
(
auto
*
d
:
node
->
args
->
defaults
)
for
(
auto
*
d
:
node
->
decorator_list
)
d
->
accept
(
this
);
d
->
accept
(
this
);
node
->
args
->
accept
(
this
);
_doStore
(
node
->
name
);
_doStore
(
node
->
name
);
return
true
;
return
true
;
...
@@ -124,10 +131,11 @@ public:
...
@@ -124,10 +131,11 @@ public:
bool
visit_name
(
AST_Name
*
node
)
{
bool
visit_name
(
AST_Name
*
node
)
{
if
(
node
->
ctx_type
==
AST_TYPE
::
Load
)
if
(
node
->
ctx_type
==
AST_TYPE
::
Load
)
_doLoad
(
node
->
id
,
node
);
_doLoad
(
node
->
id
,
node
);
else
if
(
node
->
ctx_type
==
AST_TYPE
::
Store
||
node
->
ctx_type
==
AST_TYPE
::
Del
)
else
if
(
node
->
ctx_type
==
AST_TYPE
::
Store
||
node
->
ctx_type
==
AST_TYPE
::
Del
||
node
->
ctx_type
==
AST_TYPE
::
Param
)
_doStore
(
node
->
id
);
_doStore
(
node
->
id
);
else
{
else
{
assert
(
0
);
ASSERT
(
0
,
"%d"
,
node
->
ctx_type
);
abort
();
abort
();
}
}
return
true
;
return
true
;
...
...
src/core/ast.cpp
View file @
2ae61c64
...
@@ -706,6 +706,8 @@ void AST_Repr::accept(ASTVisitor* v) {
...
@@ -706,6 +706,8 @@ void AST_Repr::accept(ASTVisitor* v) {
bool
skip
=
v
->
visit_repr
(
this
);
bool
skip
=
v
->
visit_repr
(
this
);
if
(
skip
)
if
(
skip
)
return
;
return
;
value
->
accept
(
v
);
}
}
void
*
AST_Repr
::
accept_expr
(
ExprVisitor
*
v
)
{
void
*
AST_Repr
::
accept_expr
(
ExprVisitor
*
v
)
{
...
...
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