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
aa5c5de4
Unverified
Commit
aa5c5de4
authored
Jun 03, 2018
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Jun 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4033 from i110/i110/fix-envadjust
fix env->stack misadjusting: fix #4029
parents
39526074
edaa7a1b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/vm.c
src/vm.c
+4
-4
No files found.
src/vm.c
View file @
aa5c5de4
...
@@ -141,7 +141,7 @@ stack_init(mrb_state *mrb)
...
@@ -141,7 +141,7 @@ stack_init(mrb_state *mrb)
}
}
static
inline
void
static
inline
void
envadjust
(
mrb_state
*
mrb
,
mrb_value
*
oldbase
,
mrb_value
*
newbase
,
size_t
size
)
envadjust
(
mrb_state
*
mrb
,
mrb_value
*
oldbase
,
mrb_value
*
newbase
,
size_t
old
size
)
{
{
mrb_callinfo
*
ci
=
mrb
->
c
->
cibase
;
mrb_callinfo
*
ci
=
mrb
->
c
->
cibase
;
...
@@ -151,7 +151,7 @@ envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase, size_t size)
...
@@ -151,7 +151,7 @@ envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase, size_t size)
mrb_value
*
st
;
mrb_value
*
st
;
if
(
e
&&
MRB_ENV_STACK_SHARED_P
(
e
)
&&
if
(
e
&&
MRB_ENV_STACK_SHARED_P
(
e
)
&&
(
st
=
e
->
stack
)
&&
oldbase
<=
st
&&
st
<
oldbase
+
size
)
{
(
st
=
e
->
stack
)
&&
oldbase
<=
st
&&
st
<
oldbase
+
old
size
)
{
ptrdiff_t
off
=
e
->
stack
-
oldbase
;
ptrdiff_t
off
=
e
->
stack
-
oldbase
;
e
->
stack
=
newbase
+
off
;
e
->
stack
=
newbase
+
off
;
...
@@ -161,7 +161,7 @@ envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase, size_t size)
...
@@ -161,7 +161,7 @@ envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase, size_t size)
e
=
MRB_PROC_ENV
(
ci
->
proc
);
e
=
MRB_PROC_ENV
(
ci
->
proc
);
if
(
e
&&
MRB_ENV_STACK_SHARED_P
(
e
)
&&
if
(
e
&&
MRB_ENV_STACK_SHARED_P
(
e
)
&&
(
st
=
e
->
stack
)
&&
oldbase
<=
st
&&
st
<
oldbase
+
size
)
{
(
st
=
e
->
stack
)
&&
oldbase
<=
st
&&
st
<
oldbase
+
old
size
)
{
ptrdiff_t
off
=
e
->
stack
-
oldbase
;
ptrdiff_t
off
=
e
->
stack
-
oldbase
;
e
->
stack
=
newbase
+
off
;
e
->
stack
=
newbase
+
off
;
...
@@ -205,7 +205,7 @@ stack_extend_alloc(mrb_state *mrb, int room)
...
@@ -205,7 +205,7 @@ stack_extend_alloc(mrb_state *mrb, int room)
mrb_exc_raise
(
mrb
,
mrb_obj_value
(
mrb
->
stack_err
));
mrb_exc_raise
(
mrb
,
mrb_obj_value
(
mrb
->
stack_err
));
}
}
stack_clear
(
&
(
newstack
[
oldsize
]),
size
-
oldsize
);
stack_clear
(
&
(
newstack
[
oldsize
]),
size
-
oldsize
);
envadjust
(
mrb
,
oldbase
,
newstack
,
size
);
envadjust
(
mrb
,
oldbase
,
newstack
,
old
size
);
mrb
->
c
->
stbase
=
newstack
;
mrb
->
c
->
stbase
=
newstack
;
mrb
->
c
->
stack
=
mrb
->
c
->
stbase
+
off
;
mrb
->
c
->
stack
=
mrb
->
c
->
stbase
+
off
;
mrb
->
c
->
stend
=
mrb
->
c
->
stbase
+
size
;
mrb
->
c
->
stend
=
mrb
->
c
->
stbase
+
size
;
...
...
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