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
e91b6a03
Commit
e91b6a03
authored
Aug 29, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4080 from 'ukrainskiysergey-node_negate_fix'
parents
98c759e8
441ff45a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+7
-10
No files found.
mrbgems/mruby-compiler/core/codegen.c
View file @
e91b6a03
...
@@ -2406,12 +2406,11 @@ codegen(codegen_scope *s, node *tree, int val)
...
@@ -2406,12 +2406,11 @@ codegen(codegen_scope *s, node *tree, int val)
case
NODE_NEGATE
:
case
NODE_NEGATE
:
{
{
nt
=
nint
(
tree
->
car
);
nt
=
nint
(
tree
->
car
);
tree
=
tree
->
cdr
;
switch
(
nt
)
{
switch
(
nt
)
{
#ifndef MRB_WITHOUT_FLOAT
#ifndef MRB_WITHOUT_FLOAT
case
NODE_FLOAT
:
case
NODE_FLOAT
:
if
(
val
)
{
if
(
val
)
{
char
*
p
=
(
char
*
)
tree
;
char
*
p
=
(
char
*
)
tree
->
cdr
;
mrb_float
f
=
mrb_float_read
(
p
,
NULL
);
mrb_float
f
=
mrb_float_read
(
p
,
NULL
);
int
off
=
new_lit
(
s
,
mrb_float_value
(
s
->
mrb
,
-
f
));
int
off
=
new_lit
(
s
,
mrb_float_value
(
s
->
mrb
,
-
f
));
...
@@ -2423,8 +2422,8 @@ codegen(codegen_scope *s, node *tree, int val)
...
@@ -2423,8 +2422,8 @@ codegen(codegen_scope *s, node *tree, int val)
case
NODE_INT
:
case
NODE_INT
:
if
(
val
)
{
if
(
val
)
{
char
*
p
=
(
char
*
)
tree
->
car
;
char
*
p
=
(
char
*
)
tree
->
c
dr
->
c
ar
;
int
base
=
nint
(
tree
->
cdr
->
car
);
int
base
=
nint
(
tree
->
cdr
->
c
dr
->
c
ar
);
mrb_int
i
;
mrb_int
i
;
mrb_bool
overflow
;
mrb_bool
overflow
;
...
@@ -2455,13 +2454,11 @@ codegen(codegen_scope *s, node *tree, int val)
...
@@ -2455,13 +2454,11 @@ codegen(codegen_scope *s, node *tree, int val)
default:
default:
if
(
val
)
{
if
(
val
)
{
int
sym
=
new_sym
(
s
,
mrb_intern_lit
(
s
->
mrb
,
"-"
));
int
sym
=
new_sym
(
s
,
mrb_intern_lit
(
s
->
mrb
,
"-@"
));
genop_1
(
s
,
OP_LOADI_0
,
cursp
());
push
();
codegen
(
s
,
tree
,
VAL
);
codegen
(
s
,
tree
,
VAL
);
pop
();
pop
();
pop
();
genop_2
(
s
,
OP_SUB
,
cursp
(),
sym
);
genop_3
(
s
,
OP_SEND
,
cursp
(),
sym
,
0
);
push
();
}
}
else
{
else
{
codegen
(
s
,
tree
,
NOVAL
);
codegen
(
s
,
tree
,
NOVAL
);
...
...
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