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
88ca604b
Commit
88ca604b
authored
Feb 29, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More ref fixes
parent
ec8adc6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+2
-3
src/runtime/types.cpp
src/runtime/types.cpp
+7
-5
No files found.
src/runtime/objmodel.cpp
View file @
88ca604b
...
...
@@ -4087,7 +4087,7 @@ void rearrangeArgumentsInternal(ParamReceiveSpec paramspec, const ParamNames* pa
if
(
!
param_names
||
!
param_names
->
takes_param_names
)
{
assert
(
!
rewrite_args
);
// would need to add it to r_kwargs
okwargs
->
d
[
(
*
keyword_names
)[
i
]]
=
kw_val
;
okwargs
->
d
[
incref
((
*
keyword_names
)[
i
])]
=
incref
(
kw_val
)
;
continue
;
}
...
...
@@ -4297,7 +4297,6 @@ Box* callFunc(BoxedFunctionBase* func, CallRewriteArgs* rewrite_args, ArgPassSpe
AUTO_XDECREF_ARRAY
(
oargs
,
num_output_args
-
3
);
if
(
rewrite_args
&&
!
rewrite_success
)
{
assert
(
0
&&
"check refcounting"
);
// These are the cases that we weren't able to rewrite.
// So instead, just rewrite them to be a call to callFunc, which helps a little bit.
// TODO we should extract the rest of this function from the end of this block,
...
...
@@ -4352,7 +4351,7 @@ Box* callFunc(BoxedFunctionBase* func, CallRewriteArgs* rewrite_args, ArgPassSpe
arg_vec
.
push_back
(
args_array
);
for
(
auto
v
:
arg_vec
)
assert
(
v
);
RewriterVar
*
r_rtn
=
rewriter
->
call
(
true
,
(
void
*
)
_callFuncHelper
<
S
>
,
arg_vec
);
RewriterVar
*
r_rtn
=
rewriter
->
call
(
true
,
(
void
*
)
_callFuncHelper
<
S
>
,
arg_vec
)
->
setType
(
RefType
::
OWNED
)
;
rewrite_args
->
out_success
=
true
;
rewrite_args
->
out_rtn
=
r_rtn
;
...
...
src/runtime/types.cpp
View file @
88ca604b
...
...
@@ -2472,8 +2472,6 @@ public:
RELEASE_ASSERT
(
_self
->
cls
==
attrwrapper_cls
,
""
);
AttrWrapper
*
self
=
static_cast
<
AttrWrapper
*>
(
_self
);
assert
(
0
&&
"check refcounting"
);
assert
(
args
->
cls
==
tuple_cls
);
assert
(
!
kwargs
||
kwargs
->
cls
==
dict_cls
);
...
...
@@ -2495,14 +2493,18 @@ public:
// Hopefully this does not happen very often.
if
(
!
PyDict_Check
(
_container
))
{
BoxedDict
*
new_container
=
new
BoxedDict
();
dictUpdate
(
new_container
,
BoxedTuple
::
create
({
_container
}),
new
BoxedDict
()
);
dictUpdate
(
new_container
,
autoDecref
(
BoxedTuple
::
create
({
_container
})),
NULL
);
_container
=
new_container
;
}
else
{
Py_INCREF
(
_container
);
}
AUTO_DECREF
(
_container
);
assert
(
PyDict_Check
(
_container
));
BoxedDict
*
container
=
static_cast
<
BoxedDict
*>
(
_container
);
for
(
const
auto
&
p
:
*
container
)
{
AttrWrapper
::
setitem
(
self
,
p
.
first
,
p
.
second
);
autoDecref
(
AttrWrapper
::
setitem
(
self
,
p
.
first
,
p
.
second
)
);
}
}
};
...
...
@@ -2513,7 +2515,7 @@ public:
if
(
kwargs
)
handle
(
kwargs
);
return
None
;
Py_RETURN_NONE
;
}
static
Box
*
iter
(
Box
*
_self
)
noexcept
{
...
...
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