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
fd38b921
Unverified
Commit
fd38b921
authored
Oct 23, 2020
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Oct 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5100 from dearblue/getargv-array
Prohibit array changes by `mrb_get_argv()`
parents
27492e53
edc49f9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
include/mruby.h
include/mruby.h
+1
-1
src/array.c
src/array.c
+2
-2
src/class.c
src/class.c
+1
-1
No files found.
include/mruby.h
View file @
fd38b921
...
...
@@ -991,7 +991,7 @@ MRB_API mrb_int mrb_get_argc(mrb_state *mrb);
*
* Correctly handles *splat arguments.
*/
MRB_API
mrb_value
*
mrb_get_argv
(
mrb_state
*
mrb
);
MRB_API
const
mrb_value
*
mrb_get_argv
(
mrb_state
*
mrb
);
/**
* Retrieve the first and only argument from mrb_state.
...
...
src/array.c
View file @
fd38b921
...
...
@@ -509,7 +509,7 @@ static mrb_value
mrb_ary_push_m
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_int
argc
;
mrb_value
*
argv
;
const
mrb_value
*
argv
;
mrb_int
len
,
len2
;
struct
RArray
*
a
;
...
...
@@ -947,7 +947,7 @@ mrb_ary_aset(mrb_state *mrb, mrb_value self)
ary_modify
(
mrb
,
mrb_ary_ptr
(
self
));
if
(
mrb_get_argc
(
mrb
)
==
2
)
{
mrb_value
*
vs
=
mrb_get_argv
(
mrb
);
const
mrb_value
*
vs
=
mrb_get_argv
(
mrb
);
v1
=
vs
[
0
];
v2
=
vs
[
1
];
/* a[n..m] = v */
...
...
src/class.c
View file @
fd38b921
...
...
@@ -806,7 +806,7 @@ mrb_get_argc(mrb_state *mrb)
return
argc
;
}
MRB_API
mrb_value
*
MRB_API
const
mrb_value
*
mrb_get_argv
(
mrb_state
*
mrb
)
{
mrb_int
argc
=
mrb
->
c
->
ci
->
argc
;
...
...
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