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
746ff8a1
Commit
746ff8a1
authored
Apr 05, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a missing nullable annotation
parent
f5b3bce6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
10 deletions
+7
-10
src/codegen/compvars.cpp
src/codegen/compvars.cpp
+6
-7
src/runtime/iterobject.cpp
src/runtime/iterobject.cpp
+1
-1
test/tests/iter_gc.py
test/tests/iter_gc.py
+0
-1
test/tests/seqiter_protocol.py
test/tests/seqiter_protocol.py
+0
-1
No files found.
src/codegen/compvars.cpp
View file @
746ff8a1
...
...
@@ -576,11 +576,10 @@ CompilerVariable* UnknownType::getattr(IREmitter& emitter, const OpInfo& info, C
return
new
ConcreteCompilerVariable
(
UNKNOWN
,
rtn_val
);
}
static
ConcreteCompilerVariable
*
_call
(
IREmitter
&
emitter
,
const
OpInfo
&
info
,
llvm
::
Value
*
func
,
ExceptionStyle
target_exception_style
,
void
*
func_addr
,
const
std
::
vector
<
llvm
::
Value
*>&
other_args
,
ArgPassSpec
argspec
,
const
std
::
vector
<
CompilerVariable
*>&
args
,
const
std
::
vector
<
BoxedString
*>*
keyword_names
,
ConcreteCompilerType
*
rtn_type
)
{
static
ConcreteCompilerVariable
*
_call
(
IREmitter
&
emitter
,
const
OpInfo
&
info
,
llvm
::
Value
*
func
,
ExceptionStyle
target_exception_style
,
void
*
func_addr
,
const
std
::
vector
<
llvm
::
Value
*>&
other_args
,
ArgPassSpec
argspec
,
const
std
::
vector
<
CompilerVariable
*>&
args
,
const
std
::
vector
<
BoxedString
*>*
keyword_names
,
ConcreteCompilerType
*
rtn_type
,
bool
nullable_return
=
false
)
{
bool
pass_keyword_names
=
(
keyword_names
!=
nullptr
);
assert
(
pass_keyword_names
==
(
argspec
.
num_keywords
>
0
));
...
...
@@ -683,7 +682,7 @@ static ConcreteCompilerVariable* _call(IREmitter& emitter, const OpInfo& info, l
if
(
rtn_type
->
getBoxType
()
==
rtn_type
)
{
emitter
.
setType
(
rtn
,
RefType
::
OWNED
);
if
(
target_exception_style
==
CAPI
)
if
(
nullable_return
||
target_exception_style
==
CAPI
)
emitter
.
setNullable
(
rtn
,
true
);
}
assert
(
rtn
->
getType
()
==
rtn_type
->
llvmType
());
...
...
@@ -759,7 +758,7 @@ CompilerVariable* UnknownType::callattr(IREmitter& emitter, const OpInfo& info,
other_args
.
push_back
(
emitter
.
setType
(
embedRelocatablePtr
(
attr
,
g
.
llvm_boxedstring_type_ptr
),
RefType
::
BORROWED
));
other_args
.
push_back
(
getConstantInt
(
flags
.
asInt
(),
g
.
i64
));
return
_call
(
emitter
,
info
,
func
,
exception_style
,
func_ptr
,
other_args
,
flags
.
argspec
,
args
,
keyword_names
,
UNKNOWN
);
UNKNOWN
,
/* nullable_return = */
flags
.
null_on_nonexistent
);
}
ConcreteCompilerVariable
*
UnknownType
::
nonzero
(
IREmitter
&
emitter
,
const
OpInfo
&
info
,
ConcreteCompilerVariable
*
var
)
{
...
...
src/runtime/iterobject.cpp
View file @
746ff8a1
...
...
@@ -72,7 +72,7 @@ Box* seqiterHasnext(Box* s) {
}
llvm_compat_bool
seqiterHasnextUnboxed
(
Box
*
s
)
{
return
unboxBool
(
seqiterHasnext
(
s
));
return
unboxBool
(
autoDecref
(
seqiterHasnext
(
s
)
));
}
Box
*
seqreviterHasnext_capi
(
Box
*
s
)
noexcept
{
...
...
test/tests/iter_gc.py
View file @
746ff8a1
# expected: reffail
# Regression test: make sure we GC special iterator objects correctly
import
gc
...
...
test/tests/seqiter_protocol.py
View file @
746ff8a1
# expected: reffail
# Objects are iterable if they just implement __getitem__:
class
C
(
object
):
...
...
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