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
1da11c84
Commit
1da11c84
authored
Mar 07, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PyIter_Next refcounting bug
parent
2f54cb05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+12
-10
src/runtime/types.cpp
src/runtime/types.cpp
+1
-0
No files found.
src/asm_writing/rewriter.cpp
View file @
1da11c84
...
...
@@ -47,6 +47,14 @@ static const assembler::XMMRegister allocatable_xmm_regs[]
assembler
::
XMM6
,
assembler
::
XMM7
,
assembler
::
XMM8
,
assembler
::
XMM9
,
assembler
::
XMM10
,
assembler
::
XMM11
,
assembler
::
XMM12
,
assembler
::
XMM13
,
assembler
::
XMM14
,
assembler
::
XMM15
};
static
const
Location
caller_save_registers
[]{
assembler
::
RAX
,
assembler
::
RCX
,
assembler
::
RDX
,
assembler
::
RSI
,
assembler
::
RDI
,
assembler
::
R8
,
assembler
::
R9
,
assembler
::
R10
,
assembler
::
R11
,
assembler
::
XMM0
,
assembler
::
XMM1
,
assembler
::
XMM2
,
assembler
::
XMM3
,
assembler
::
XMM4
,
assembler
::
XMM5
,
assembler
::
XMM6
,
assembler
::
XMM7
,
assembler
::
XMM8
,
assembler
::
XMM9
,
assembler
::
XMM10
,
assembler
::
XMM11
,
assembler
::
XMM12
,
assembler
::
XMM13
,
assembler
::
XMM14
,
assembler
::
XMM15
,
};
Location
Location
::
forArg
(
int
argnum
)
{
assert
(
argnum
>=
0
);
switch
(
argnum
)
{
...
...
@@ -567,10 +575,12 @@ void Rewriter::_decref(RewriterVar* var) {
{
assembler
::
ForwardJump
jnz
(
*
assembler
,
assembler
::
COND_NOT_ZERO
);
#ifdef Py_TRACE_REFS
RELEASE_ASSERT
(
0
,
"need to support trace_refs here (call _Py_Dealloc instead of tp_dealloc"
);
#endif
assembler
->
mov
(
assembler
::
Immediate
((
void
*
)
_Py_Dealloc
),
assembler
::
R11
);
assembler
->
callq
(
assembler
::
R11
);
#else
assembler
->
movq
(
assembler
::
Indirect
(
reg
,
offsetof
(
Box
,
cls
)),
assembler
::
RAX
);
assembler
->
callq
(
assembler
::
Indirect
(
assembler
::
RAX
,
offsetof
(
BoxedClass
,
tp_dealloc
)));
#endif
//assembler->mov(assembler::Indirect(assembler::RAX, offsetof(BoxedClass, tp_dealloc)), assembler::R11);
//assembler->callq(assembler::R11);
}
...
...
@@ -924,14 +934,6 @@ RewriterVar* Rewriter::call(bool has_side_effects, void* func_addr, RewriterVar*
return
call
(
has_side_effects
,
func_addr
,
args
,
args_xmm
);
}
static
const
Location
caller_save_registers
[]{
assembler
::
RAX
,
assembler
::
RCX
,
assembler
::
RDX
,
assembler
::
RSI
,
assembler
::
RDI
,
assembler
::
R8
,
assembler
::
R9
,
assembler
::
R10
,
assembler
::
R11
,
assembler
::
XMM0
,
assembler
::
XMM1
,
assembler
::
XMM2
,
assembler
::
XMM3
,
assembler
::
XMM4
,
assembler
::
XMM5
,
assembler
::
XMM6
,
assembler
::
XMM7
,
assembler
::
XMM8
,
assembler
::
XMM9
,
assembler
::
XMM10
,
assembler
::
XMM11
,
assembler
::
XMM12
,
assembler
::
XMM13
,
assembler
::
XMM14
,
assembler
::
XMM15
,
};
RewriterVar
*
Rewriter
::
call
(
bool
has_side_effects
,
void
*
func_addr
,
const
RewriterVar
::
SmallVector
&
args
,
const
RewriterVar
::
SmallVector
&
args_xmm
)
{
RewriterVar
*
result
=
createNewVar
();
...
...
src/runtime/types.cpp
View file @
1da11c84
...
...
@@ -185,6 +185,7 @@ extern "C" PyObject* PyIter_Next(PyObject* iter) noexcept {
else
{
try
{
Box
*
hasnext
=
iter
->
hasnextOrNullIC
();
AUTO_XDECREF
(
hasnext
);
if
(
hasnext
&&
!
hasnext
->
nonzeroIC
())
return
NULL
;
}
catch
(
ExcInfo
e
)
{
...
...
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