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
cdba6c21
Commit
cdba6c21
authored
Aug 08, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't crash when a generator has more than 3 arguments and kwargs
parent
802ad225
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
src/runtime/generator.cpp
src/runtime/generator.cpp
+1
-1
test/tests/generators.py
test/tests/generators.py
+5
-0
No files found.
src/runtime/generator.cpp
View file @
cdba6c21
...
@@ -467,7 +467,7 @@ extern "C" BoxedGenerator::BoxedGenerator(BoxedFunctionBase* function, Box* arg1
...
@@ -467,7 +467,7 @@ extern "C" BoxedGenerator::BoxedGenerator(BoxedFunctionBase* function, Box* arg1
this
->
args
=
new
(
numArgs
)
GCdArray
();
this
->
args
=
new
(
numArgs
)
GCdArray
();
memcpy
(
&
this
->
args
->
elts
[
0
],
args
,
numArgs
*
sizeof
(
Box
*
));
memcpy
(
&
this
->
args
->
elts
[
0
],
args
,
numArgs
*
sizeof
(
Box
*
));
for
(
int
i
=
0
;
i
<
numArgs
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numArgs
;
i
++
)
{
Py_INCREF
(
args
[
i
]);
Py_
X
INCREF
(
args
[
i
]);
}
}
}
}
...
...
test/tests/generators.py
View file @
cdba6c21
...
@@ -142,3 +142,8 @@ def this_is_not_generator():
...
@@ -142,3 +142,8 @@ def this_is_not_generator():
def
f
():
def
f
():
yield
yield
print
type
(
this_is_not_generator
())
print
type
(
this_is_not_generator
())
# we used to crash when a generator had more than 3 arguments and kwargs (because they can be NULL)
def
G
(
a
,
b
,
c
,
*
args
,
**
kwargs
):
yield
1
print
list
(
G
(
1
,
2
,
2
))
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