Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
50f56227
Commit
50f56227
authored
Nov 09, 2015
by
Paul Sokolovsky
Browse files
py/objint_longlong: Instead of assert, throw OverflowError.
parent
c27e5c4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objint_longlong.c
View file @
50f56227
...
...
@@ -231,7 +231,9 @@ mp_obj_t mp_obj_new_int_from_ll(long long val) {
mp_obj_t
mp_obj_new_int_from_ull
(
unsigned
long
long
val
)
{
// TODO raise an exception if the unsigned long long won't fit
assert
(
val
>>
(
sizeof
(
unsigned
long
long
)
*
8
-
1
)
==
0
);
if
(
val
>>
(
sizeof
(
unsigned
long
long
)
*
8
-
1
)
!=
0
)
{
nlr_raise
(
mp_obj_new_exception_msg_varg
(
&
mp_type_OverflowError
,
"ulonglong too large"
));
}
mp_obj_int_t
*
o
=
m_new_obj
(
mp_obj_int_t
);
o
->
base
.
type
=
&
mp_type_int
;
o
->
val
=
val
;
...
...
Write
Preview
Supports
Markdown
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