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
9b46190c
Commit
9b46190c
authored
8 years ago
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix this set issue
parent
09470b2e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+3
-2
test/tests/set.expected
test/tests/set.expected
+1
-0
test/tests/set.py
test/tests/set.py
+5
-0
No files found.
src/codegen/ast_interpreter.cpp
View file @
9b46190c
...
...
@@ -1664,11 +1664,11 @@ Value ASTInterpreter::visit_dict(AST_Dict* node) {
}
Value
ASTInterpreter
::
visit_set
(
AST_Set
*
node
)
{
BoxedSet
*
set
=
(
BoxedSet
*
)
createSet
();
try
{
// insert the elements in reverse like cpython does
// important for {1, 1L}
llvm
::
SmallVector
<
RewriterVar
*
,
8
>
items
;
BoxedSet
*
set
=
(
BoxedSet
*
)
createSet
();
for
(
auto
it
=
node
->
elts
.
rbegin
(),
it_end
=
node
->
elts
.
rend
();
it
!=
it_end
;
++
it
)
{
Value
v
=
visit_expr
(
*
it
);
_setAddStolen
(
set
,
v
.
o
);
...
...
@@ -1676,7 +1676,8 @@ Value ASTInterpreter::visit_set(AST_Set* node) {
}
return
Value
(
set
,
jit
?
jit
->
emitCreateSet
(
items
)
:
NULL
);
}
catch
(
ExcInfo
e
)
{
RELEASE_ASSERT
(
0
,
"this leaks in case of an exception"
);
Py_DECREF
(
set
);
throw
e
;
}
}
...
...
This diff is collapsed.
Click to expand it.
test/tests/set.expected
View file @
9b46190c
...
...
@@ -540,3 +540,4 @@ False
set([1L]) set([1]) set([1]) set([1L])
set([1])
4
unhashable type: 'dict'
This diff is collapsed.
Click to expand it.
test/tests/set.py
View file @
9b46190c
...
...
@@ -274,3 +274,8 @@ from api_test import set_size
s
=
set
([
1
,
2
,
3
,
4
])
print
(
set_size
(
s
))
try
:
{{}}
except
Exception
as
e
:
print
e
This diff is collapsed.
Click to expand it.
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