Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
98799aa6
Unverified
Commit
98799aa6
authored
Mar 24, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix infinite recursive call bugs in integer division.
parent
3deb62d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
mrbgems/mruby-complex/src/complex.c
mrbgems/mruby-complex/src/complex.c
+2
-0
mrbgems/mruby-rational/src/rational.c
mrbgems/mruby-rational/src/rational.c
+2
-0
No files found.
mrbgems/mruby-complex/src/complex.c
View file @
98799aa6
...
...
@@ -304,6 +304,7 @@ int_div(mrb_state *mrb, mrb_value x)
}
switch
(
mrb_type
(
y
))
{
case
MRB_TT_COMPLEX
:
x
=
complex_new
(
mrb
,
(
mrb_float
)
a
,
0
);
return
mrb_funcall_id
(
mrb
,
x
,
MRB_OPSYM
(
div
),
1
,
y
);
default:
return
mrb_float_value
(
mrb
,
(
mrb_float
)
a
*
mrb_to_flo
(
mrb
,
y
));
...
...
@@ -323,6 +324,7 @@ int_quo(mrb_state *mrb, mrb_value x)
switch
(
mrb_type
(
y
))
{
case
MRB_TT_COMPLEX
:
x
=
complex_new
(
mrb
,
(
mrb_float
)
a
,
0
);
return
mrb_funcall_id
(
mrb
,
x
,
MRB_OPSYM
(
div
),
1
,
y
);
default:
return
mrb_float_value
(
mrb
,
(
mrb_float
)
a
*
mrb_to_flo
(
mrb
,
y
));
...
...
mrbgems/mruby-rational/src/rational.c
View file @
98799aa6
...
...
@@ -428,6 +428,7 @@ int_div(mrb_state *mrb, mrb_value x)
return
mrb_funcall_id
(
mrb
,
x
,
MRB_OPSYM
(
div
),
1
,
y
);
#if defined(MRB_USE_COMPLEX)
case
MRB_TT_COMPLEX
:
x
=
mrb_complex_new
(
mrb
,
(
mrb_float
)
a
,
0
);
return
mrb_funcall_id
(
mrb
,
x
,
MRB_OPSYM
(
div
),
1
,
y
);
#endif
case
MRB_TT_FLOAT
:
...
...
@@ -460,6 +461,7 @@ int_quo(mrb_state *mrb, mrb_value x)
return
mrb_funcall_id
(
mrb
,
x
,
MRB_OPSYM
(
div
),
1
,
y
);
#if defined(MRB_USE_COMPLEX)
case
MRB_TT_COMPLEX
:
x
=
mrb_complex_new
(
mrb
,
(
mrb_float
)
a
,
0
);
return
mrb_funcall_id
(
mrb
,
x
,
MRB_OPSYM
(
div
),
1
,
y
);
#endif
default:
...
...
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