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
ed56d56d
Commit
ed56d56d
authored
Dec 17, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid out-of-bounds access of irep->lv; ref #2671, fix #2675
allocation size of irep->iv is irep->nlocals-1.
parent
a19a6edb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
mrbgems/mruby-eval/src/eval.c
mrbgems/mruby-eval/src/eval.c
+5
-7
No files found.
mrbgems/mruby-eval/src/eval.c
View file @
ed56d56d
...
@@ -55,18 +55,18 @@ search_variable(mrb_state *mrb, mrb_sym vsym, int bnest)
...
@@ -55,18 +55,18 @@ search_variable(mrb_state *mrb, mrb_sym vsym, int bnest)
return
0
;
return
0
;
}
}
static
int
static
mrb_bool
potential_upvar_p
(
struct
mrb_locals
*
lv
,
uint16_t
v
,
uint16_t
nlocals
)
potential_upvar_p
(
struct
mrb_locals
*
lv
,
uint16_t
v
,
uint16_t
nlocals
)
{
{
int
i
;
int
i
;
if
(
v
>=
nlocals
)
return
FALSE
;
/* skip arguments */
/* skip arguments */
for
(
i
=
0
;
i
<
nlocals
;
i
++
)
{
for
(
i
=
0
;
i
<
nlocals
-
1
;
i
++
)
{
if
(
lv
[
i
].
name
==
0
)
if
(
lv
[
i
].
name
==
0
)
break
;
return
i
<
v
;
}
}
if
(
i
==
nlocals
)
return
v
<
nlocals
;
return
TRUE
;
return
i
<
v
&&
v
<
nlocals
;
}
}
static
void
static
void
...
@@ -126,8 +126,6 @@ patch_irep(mrb_state *mrb, mrb_irep *irep, int bnest)
...
@@ -126,8 +126,6 @@ patch_irep(mrb_state *mrb, mrb_irep *irep, int bnest)
}
}
}
}
void
mrb_codedump_all
(
mrb_state
*
mrb
,
struct
RProc
*
proc
);
static
struct
RProc
*
static
struct
RProc
*
create_proc_from_string
(
mrb_state
*
mrb
,
char
*
s
,
int
len
,
mrb_value
binding
,
char
*
file
,
mrb_int
line
)
create_proc_from_string
(
mrb_state
*
mrb
,
char
*
s
,
int
len
,
mrb_value
binding
,
char
*
file
,
mrb_int
line
)
{
{
...
...
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