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
e228e38b
Commit
e228e38b
authored
Mar 12, 2015
by
Dong-hee,Na
Committed by
Kevin Modzelewski
Mar 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick fix for support long type in range() function
parent
8d4601e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+12
-16
No files found.
src/runtime/builtin_modules/builtins.cpp
View file @
e228e38b
...
...
@@ -410,27 +410,23 @@ extern "C" Box* ord(Box* obj) {
Box
*
range
(
Box
*
start
,
Box
*
stop
,
Box
*
step
)
{
i64
istart
,
istop
,
istep
;
if
(
stop
==
NULL
)
{
RELEASE_ASSERT
(
isSubclass
(
start
->
cls
,
int_cls
),
"%s"
,
getTypeName
(
start
));
istart
=
0
;
istop
=
static_cast
<
BoxedInt
*>
(
start
)
->
n
;
istop
=
PyLong_AsLong
(
start
);
checkAndThrowCAPIException
();
istep
=
1
;
}
else
if
(
step
==
NULL
)
{
RELEASE_ASSERT
(
isSubclass
(
start
->
cls
,
int_cls
),
"%s"
,
getTypeName
(
start
));
RELEASE_ASSERT
(
isSubclass
(
stop
->
cls
,
int_cls
),
"%s"
,
getTypeName
(
stop
));
istart
=
static_cast
<
BoxedInt
*>
(
start
)
->
n
;
istop
=
static_cast
<
BoxedInt
*>
(
stop
)
->
n
;
istart
=
PyLong_AsLong
(
start
);
checkAndThrowCAPIException
();
istop
=
PyLong_AsLong
(
stop
);
checkAndThrowCAPIException
();
istep
=
1
;
}
else
{
RELEASE_ASSERT
(
isSubclass
(
start
->
cls
,
int_cls
),
"%s"
,
getTypeName
(
start
));
RELEASE_ASSERT
(
isSubclass
(
stop
->
cls
,
int_cls
),
"%s"
,
getTypeName
(
stop
));
RELEASE_ASSERT
(
isSubclass
(
step
->
cls
,
int_cls
),
"%s"
,
getTypeName
(
step
));
istart
=
static_cast
<
BoxedInt
*>
(
start
)
->
n
;
istop
=
static_cast
<
BoxedInt
*>
(
stop
)
->
n
;
istep
=
static_cast
<
BoxedInt
*>
(
step
)
->
n
;
RELEASE_ASSERT
(
istep
!=
0
,
"step can't be 0"
);
istart
=
PyLong_AsLong
(
start
);
checkAndThrowCAPIException
();
istop
=
PyLong_AsLong
(
stop
);
checkAndThrowCAPIException
();
istep
=
PyLong_AsLong
(
step
);
checkAndThrowCAPIException
();
}
BoxedList
*
rtn
=
new
BoxedList
();
...
...
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