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
68714ab6
Unverified
Commit
68714ab6
authored
Oct 29, 2018
by
take-cheeze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SEGV
parent
e0220803
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
src/vm.c
src/vm.c
+14
-12
No files found.
src/vm.c
View file @
68714ab6
...
@@ -2442,13 +2442,13 @@ RETRY_TRY_BLOCK:
...
@@ -2442,13 +2442,13 @@ RETRY_TRY_BLOCK:
NEXT
;
NEXT
;
}
}
CASE
(
OP_ADDI
,
BB
B
)
{
CASE
(
OP_ADDI
,
BB
)
{
/* need to check if + is overridden */
/* need to check if + is overridden */
switch
(
mrb_type
(
regs
[
a
]))
{
switch
(
mrb_type
(
regs
[
a
]))
{
case
MRB_TT_FIXNUM
:
case
MRB_TT_FIXNUM
:
{
{
mrb_int
x
=
mrb_fixnum
(
regs
[
a
]);
mrb_int
x
=
mrb_fixnum
(
regs
[
a
]);
mrb_int
y
=
(
mrb_int
)
c
;
mrb_int
y
=
(
mrb_int
)
b
;
mrb_int
z
;
mrb_int
z
;
if
(
mrb_int_add_overflow
(
x
,
y
,
&
z
))
{
if
(
mrb_int_add_overflow
(
x
,
y
,
&
z
))
{
...
@@ -2465,22 +2465,23 @@ RETRY_TRY_BLOCK:
...
@@ -2465,22 +2465,23 @@ RETRY_TRY_BLOCK:
#ifdef MRB_WORD_BOXING
#ifdef MRB_WORD_BOXING
{
{
mrb_float
x
=
mrb_float
(
regs
[
a
]);
mrb_float
x
=
mrb_float
(
regs
[
a
]);
SET_FLOAT_VALUE
(
mrb
,
regs
[
a
],
x
+
c
);
SET_FLOAT_VALUE
(
mrb
,
regs
[
a
],
x
+
b
);
}
}
#else
#else
mrb_float
(
regs
[
a
])
+=
c
;
mrb_float
(
regs
[
a
])
+=
b
;
#endif
#endif
break
;
break
;
#endif
#endif
default:
default:
SET_INT_VALUE
(
regs
[
a
+
1
],
c
);
SET_INT_VALUE
(
regs
[
a
+
1
],
b
);
c
=
1
;
c
=
1
;
goto
L_SEND
;
mid
=
mrb_sym_add
;
goto
L_SEND_CONSTSYM
;
}
}
NEXT
;
NEXT
;
}
}
CASE
(
OP_SUBI
,
BB
B
)
{
CASE
(
OP_SUBI
,
BB
)
{
mrb_value
*
regs_a
=
regs
+
a
;
mrb_value
*
regs_a
=
regs
+
a
;
/* need to check if + is overridden */
/* need to check if + is overridden */
...
@@ -2488,7 +2489,7 @@ RETRY_TRY_BLOCK:
...
@@ -2488,7 +2489,7 @@ RETRY_TRY_BLOCK:
case
MRB_TT_FIXNUM
:
case
MRB_TT_FIXNUM
:
{
{
mrb_int
x
=
mrb_fixnum
(
regs_a
[
0
]);
mrb_int
x
=
mrb_fixnum
(
regs_a
[
0
]);
mrb_int
y
=
(
mrb_int
)
c
;
mrb_int
y
=
(
mrb_int
)
b
;
mrb_int
z
;
mrb_int
z
;
if
(
mrb_int_sub_overflow
(
x
,
y
,
&
z
))
{
if
(
mrb_int_sub_overflow
(
x
,
y
,
&
z
))
{
...
@@ -2505,17 +2506,18 @@ RETRY_TRY_BLOCK:
...
@@ -2505,17 +2506,18 @@ RETRY_TRY_BLOCK:
#ifdef MRB_WORD_BOXING
#ifdef MRB_WORD_BOXING
{
{
mrb_float
x
=
mrb_float
(
regs
[
a
]);
mrb_float
x
=
mrb_float
(
regs
[
a
]);
SET_FLOAT_VALUE
(
mrb
,
regs
[
a
],
(
mrb_float
)
x
-
(
mrb_float
)
c
);
SET_FLOAT_VALUE
(
mrb
,
regs
[
a
],
(
mrb_float
)
x
-
(
mrb_float
)
b
);
}
}
#else
#else
mrb_float
(
regs_a
[
0
])
-=
c
;
mrb_float
(
regs_a
[
0
])
-=
b
;
#endif
#endif
break
;
break
;
#endif
#endif
default:
default:
SET_INT_VALUE
(
regs_a
[
1
],
c
);
SET_INT_VALUE
(
regs_a
[
1
],
b
);
c
=
1
;
c
=
1
;
goto
L_SEND
;
mid
=
mrb_sym_sub
;
goto
L_SEND_CONSTSYM
;
}
}
NEXT
;
NEXT
;
}
}
...
...
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