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
2d4fd67f
Commit
2d4fd67f
authored
Feb 03, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More refcount fixes
parent
d0585d43
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+4
-2
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+3
-3
src/runtime/types.cpp
src/runtime/types.cpp
+4
-1
No files found.
src/codegen/ast_interpreter.cpp
View file @
2d4fd67f
...
...
@@ -281,16 +281,18 @@ void ASTInterpreter::initArguments(BoxedClosure* _closure, BoxedGenerator* _gene
int
i
=
0
;
for
(
auto
&
name
:
param_names
.
arg_names
)
{
doStore
(
name
,
Value
(
getArg
(
i
++
,
arg1
,
arg2
,
arg3
,
args
),
0
));
doStore
(
name
,
Value
(
incref
(
getArg
(
i
++
,
arg1
,
arg2
,
arg3
,
args
)
),
0
));
}
if
(
param_names
.
vararg_name
)
doStore
(
param_names
.
vararg_name
,
Value
(
getArg
(
i
++
,
arg1
,
arg2
,
arg3
,
args
),
0
));
doStore
(
param_names
.
vararg_name
,
Value
(
incref
(
getArg
(
i
++
,
arg1
,
arg2
,
arg3
,
args
)
),
0
));
if
(
param_names
.
kwarg_name
)
{
Box
*
val
=
getArg
(
i
++
,
arg1
,
arg2
,
arg3
,
args
);
if
(
!
val
)
val
=
createDict
();
else
Py_INCREF
(
val
);
doStore
(
param_names
.
kwarg_name
,
Value
(
val
,
0
));
}
assert
(
i
==
param_names
.
totalParameters
());
...
...
src/runtime/objmodel.cpp
View file @
2d4fd67f
...
...
@@ -191,8 +191,8 @@ extern "C" void printHelper(Box* dest, Box* var, bool nl) {
// begin code for handling of softspace
bool
new_softspace
=
!
nl
;
if
(
softspace
(
dest
,
new_softspace
))
callattrInternal
<
CXX
,
NOT_REWRITABLE
>
(
dest
,
write_str
,
CLASS_OR_INST
,
0
,
ArgPassSpec
(
1
),
space_str
,
0
,
0
,
0
,
0
);
autoDecref
(
callattrInternal
<
CXX
,
NOT_REWRITABLE
>
(
dest
,
write_str
,
CLASS_OR_INST
,
0
,
ArgPassSpec
(
1
)
,
space_str
,
0
,
0
,
0
,
0
)
);
Box
*
str_or_unicode_var
=
(
var
->
cls
==
unicode_cls
)
?
incref
(
var
)
:
str
(
var
);
Box
*
write_rtn
=
callattrInternal
<
CXX
,
NOT_REWRITABLE
>
(
dest
,
write_str
,
CLASS_OR_INST
,
0
,
ArgPassSpec
(
1
),
...
...
@@ -4156,7 +4156,7 @@ Box* callFunc(BoxedFunctionBase* func, CallRewriteArgs* rewrite_args, ArgPassSpe
Py_XDECREF
(
arg2
);
Py_XDECREF
(
arg3
);
for
(
int
i
=
0
;
i
<
num_output_args
-
3
;
i
++
)
{
Py_DECREF
(
oargs
[
i
]);
Py_
X
DECREF
(
oargs
[
i
]);
}
if
(
rewrite_args
)
{
RELEASE_ASSERT
(
num_output_args
<=
3
,
"figure out vrefs for arg array"
);
...
...
src/runtime/types.cpp
View file @
2d4fd67f
...
...
@@ -442,7 +442,7 @@ std::string BoxedModule::name() {
}
}
B
oxedString
*
BoxedModule
::
getStringConstant
(
llvm
::
StringRef
ast_str
,
bool
intern
)
{
B
ORROWED
(
BoxedString
*
)
BoxedModule
::
getStringConstant
(
llvm
::
StringRef
ast_str
,
bool
intern
)
{
BoxedString
*&
r
=
str_constants
[
ast_str
];
if
(
intern
)
{
// If we had previously created a box for this string, we have to create a new
...
...
@@ -4413,5 +4413,8 @@ extern "C" void Py_Finalize() noexcept {
teardownCodegen
();
PRINT_TOTAL_REFS
();
#ifdef Py_REF_DEBUG
assert
(
_Py_RefTotal
==
0
);
#endif
}
}
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