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
dcbfe716
Commit
dcbfe716
authored
7 years ago
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NODE_ASGN arguments may be 127 (CALL_MAXARGS) accidentally; fix #3559
parent
e22f37a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
mrbgems/mruby-compiler/core/codegen.c
mrbgems/mruby-compiler/core/codegen.c
+7
-7
No files found.
mrbgems/mruby-compiler/core/codegen.c
View file @
dcbfe716
...
...
@@ -792,7 +792,7 @@ attrsym(codegen_scope *s, mrb_sym a)
#define CALL_MAXARGS 127
static
int
gen_values
(
codegen_scope
*
s
,
node
*
t
,
int
val
)
gen_values
(
codegen_scope
*
s
,
node
*
t
,
int
val
,
int
extra
)
{
int
n
=
0
;
int
is_splat
;
...
...
@@ -800,7 +800,7 @@ gen_values(codegen_scope *s, node *t, int val)
while
(
t
)
{
is_splat
=
(
intptr_t
)
t
->
car
->
car
==
NODE_SPLAT
;
/* splat mode */
if
(
n
>=
CALL_MAXARGS
-
1
/* need to subtract one because vm.c expects an array if n == CALL_MAXARGS */
n
+
extra
>=
CALL_MAXARGS
-
1
/* need to subtract one because vm.c expects an array if n == CALL_MAXARGS */
||
is_splat
)
{
if
(
val
)
{
if
(
is_splat
&&
n
==
0
&&
(
intptr_t
)
t
->
car
->
cdr
->
car
==
NODE_ARRAY
)
{
...
...
@@ -872,7 +872,7 @@ gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
idx
=
new_msym
(
s
,
sym
);
tree
=
tree
->
cdr
->
cdr
->
car
;
if
(
tree
)
{
n
=
gen_values
(
s
,
tree
->
car
,
VAL
);
n
=
gen_values
(
s
,
tree
->
car
,
VAL
,
sp
?
1
:
0
);
if
(
n
<
0
)
{
n
=
noop
=
sendv
=
1
;
push
();
...
...
@@ -1632,7 +1632,7 @@ codegen(codegen_scope *s, node *tree, int val)
{
int
n
;
n
=
gen_values
(
s
,
tree
,
val
);
n
=
gen_values
(
s
,
tree
,
val
,
0
);
if
(
n
>=
0
)
{
if
(
val
)
{
pop_n
(
n
);
...
...
@@ -1806,7 +1806,7 @@ codegen(codegen_scope *s, node *tree, int val)
idx
=
new_msym
(
s
,
sym
(
n
->
cdr
->
car
));
if
(
n
->
cdr
->
cdr
->
car
)
{
int
base
=
cursp
()
-
1
;
int
nargs
=
gen_values
(
s
,
n
->
cdr
->
cdr
->
car
->
car
,
VAL
);
int
nargs
=
gen_values
(
s
,
n
->
cdr
->
cdr
->
car
->
car
,
VAL
,
1
);
/* copy receiver and arguments */
if
(
nargs
>=
0
)
{
...
...
@@ -1943,7 +1943,7 @@ codegen(codegen_scope *s, node *tree, int val)
if
(
tree
)
{
node
*
args
=
tree
->
car
;
if
(
args
)
{
n
=
gen_values
(
s
,
args
,
VAL
);
n
=
gen_values
(
s
,
args
,
VAL
,
0
);
if
(
n
<
0
)
{
n
=
noop
=
sendv
=
1
;
push
();
...
...
@@ -2020,7 +2020,7 @@ codegen(codegen_scope *s, node *tree, int val)
genop
(
s
,
MKOP_ABx
(
OP_BLKPUSH
,
cursp
(),
(
ainfo
<<
4
)
|
(
lv
&
0xf
)));
push
();
if
(
tree
)
{
n
=
gen_values
(
s
,
tree
,
VAL
);
n
=
gen_values
(
s
,
tree
,
VAL
,
0
);
if
(
n
<
0
)
{
n
=
sendv
=
1
;
push
();
...
...
This diff is collapsed.
Click to expand it.
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