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
98ac2eeb
Commit
98ac2eeb
authored
Feb 24, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #324 from tjhance/locals-closure-ordering
fix closure ordering bug for locals()
parents
8b42d921
973f480b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+4
-1
test/tests/locals_test.py
test/tests/locals_test.py
+16
-0
No files found.
src/codegen/unwinding.cpp
View file @
98ac2eeb
...
@@ -645,11 +645,14 @@ BoxedDict* getLocals(bool only_user_visible, bool includeClosure) {
...
@@ -645,11 +645,14 @@ BoxedDict* getLocals(bool only_user_visible, bool includeClosure) {
Box
*
val
=
closure
->
attrs
.
attr_list
->
attrs
[
offset
];
Box
*
val
=
closure
->
attrs
.
attr_list
->
attrs
[
offset
];
ScopeInfo
*
scope_info
=
cf
->
clfunc
->
source
->
getScopeInfo
();
ScopeInfo
*
scope_info
=
cf
->
clfunc
->
source
->
getScopeInfo
();
if
(
val
!=
NULL
&&
scope_info
->
refersToClosure
(
scope_info
->
internString
(
name
)))
{
if
(
val
!=
NULL
&&
scope_info
->
refersToClosure
(
scope_info
->
internString
(
name
)))
{
Box
*
boxedName
=
boxString
(
name
);
if
(
d
->
d
.
count
(
boxedName
)
==
0
)
{
d
->
d
[
boxString
(
name
)]
=
val
;
d
->
d
[
boxString
(
name
)]
=
val
;
}
}
}
}
}
}
}
}
}
return
d
;
return
d
;
}
}
...
...
test/tests/locals_test.py
View file @
98ac2eeb
...
@@ -40,3 +40,19 @@ def f4(t):
...
@@ -40,3 +40,19 @@ def f4(t):
print
sorted
(
locals
().
items
())
print
sorted
(
locals
().
items
())
f4
(
0
)
f4
(
0
)
f4
(
1
)
f4
(
1
)
def
f5
():
a
=
0
b
=
1
def
g
():
print
a
def
h
():
a
=
2
def
i
():
print
a
print
b
print
sorted
(
locals
().
items
())
i
()
h
()
g
()
f5
()
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