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
743aab56
Commit
743aab56
authored
Mar 28, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get func_arg_passing.py working
parent
bc72f09e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
src/runtime/descr.cpp
src/runtime/descr.cpp
+1
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+1
-2
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
test/tests/func_arg_passing.py
test/tests/func_arg_passing.py
+4
-1
No files found.
src/runtime/descr.cpp
View file @
743aab56
...
...
@@ -834,7 +834,7 @@ void setupDescr() {
property_cls
->
giveAttr
(
"__init__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
(
(
void
*
)
propertyInit
,
UNKNOWN
,
5
,
false
,
false
,
ParamNames
({
""
,
"fget"
,
"fset"
,
"fdel"
,
"doc"
},
""
,
""
)),
{
N
ULL
,
NULL
,
NULL
,
NULL
}));
{
N
one
,
None
,
None
,
NULL
}));
property_cls
->
giveAttr
(
"__get__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
propertyGet
,
UNKNOWN
,
3
)));
property_cls
->
giveAttr
(
"__set__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
propertySet
,
UNKNOWN
,
3
)));
property_cls
->
giveAttr
(
"__delete__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
propertyDel
,
UNKNOWN
,
2
)));
...
...
src/runtime/objmodel.cpp
View file @
743aab56
...
...
@@ -4229,7 +4229,6 @@ void rearrangeArgumentsInternal(ParamReceiveSpec paramspec, const ParamNames* pa
}
if
(
argspec
.
num_keywords
)
{
assert
(
!
rewrite_args
&&
"check refcounting"
);
assert
(
argspec
.
num_keywords
==
keyword_names
->
size
());
RewriterVar
::
SmallVector
r_vars
;
...
...
@@ -4242,7 +4241,7 @@ void rearrangeArgumentsInternal(ParamReceiveSpec paramspec, const ParamNames* pa
if
(
i
==
2
)
r_vars
.
push_back
(
rewrite_args
->
arg3
);
if
(
i
>=
3
)
r_vars
.
push_back
(
rewrite_args
->
args
->
getAttr
((
i
-
3
)
*
sizeof
(
Box
*
)));
r_vars
.
push_back
(
rewrite_args
->
args
->
getAttr
((
i
-
3
)
*
sizeof
(
Box
*
))
->
setType
(
RefType
::
BORROWED
)
);
}
}
...
...
src/runtime/types.cpp
View file @
743aab56
...
...
@@ -1630,7 +1630,7 @@ static void functionSetDefaults(Box* b, Box* v, void*) {
BoxedTuple
*
t
=
static_cast
<
BoxedTuple
*>
(
v
);
auto
old_defaults
=
func
->
defaults
;
func
->
defaults
=
incref
(
t
);
func
->
defaults
=
xincref
(
t
);
// t can be NULL for 'del f.func_defaults'
Py_XDECREF
(
old_defaults
);
func
->
dependent_ics
.
invalidateAll
();
}
...
...
test/tests/func_arg_passing.py
View file @
743aab56
# expected: reffail
def
f
():
def
f1
(
a
,
b
,
c
):
print
a
,
b
,
c
...
...
@@ -51,3 +50,7 @@ g()
del
f2
.
func_defaults
g
()
g
()
def
f4
(
a
,
b
,
c
,
d
,
e
):
print
a
,
b
,
c
,
d
,
e
f4
(
a
=
1
,
b
=
2
,
c
=
3
,
d
=
4
,
e
=
5
)
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