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
88c0d0cf
Commit
88c0d0cf
authored
Apr 29, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear all stack everytime to prevent GC crash; ref #2109
parent
29f6cdcd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
src/vm.c
src/vm.c
+17
-17
No files found.
src/vm.c
View file @
88c0d0cf
...
...
@@ -160,14 +160,14 @@ stack_extend_alloc(mrb_state *mrb, int room)
}
static
inline
void
stack_extend
(
mrb_state
*
mrb
,
int
room
,
int
init
,
int
keep
)
stack_extend
(
mrb_state
*
mrb
,
int
room
,
int
keep
)
{
if
(
mrb
->
c
->
stack
+
room
>=
mrb
->
c
->
stend
)
{
stack_extend_alloc
(
mrb
,
room
);
}
if
(
init
>
keep
)
{
if
(
room
>
keep
)
{
/* do not leave uninitialized malloc region */
stack_clear
(
&
(
mrb
->
c
->
stack
[
keep
]),
init
-
keep
);
stack_clear
(
&
(
mrb
->
c
->
stack
[
keep
]),
room
-
keep
);
}
}
...
...
@@ -381,11 +381,11 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
mrb
->
c
->
stack
=
mrb
->
c
->
stack
+
n
;
if
(
MRB_PROC_CFUNC_P
(
p
))
{
ci
->
nregs
=
argc
+
2
;
stack_extend
(
mrb
,
ci
->
nregs
,
0
,
0
);
stack_extend
(
mrb
,
ci
->
nregs
,
0
);
}
else
{
ci
->
nregs
=
p
->
body
.
irep
->
nregs
+
n
;
stack_extend
(
mrb
,
ci
->
nregs
,
p
->
body
.
irep
->
nlocals
,
argc
+
2
);
stack_extend
(
mrb
,
ci
->
nregs
,
argc
+
2
);
}
mrb
->
c
->
stack
[
0
]
=
self
;
if
(
undef
)
{
...
...
@@ -514,11 +514,11 @@ mrb_yield_with_class(mrb_state *mrb, mrb_value b, mrb_int argc, const mrb_value
mrb
->
c
->
stack
=
mrb
->
c
->
stack
+
n
;
if
(
MRB_PROC_CFUNC_P
(
p
))
{
ci
->
nregs
=
argc
+
2
;
stack_extend
(
mrb
,
ci
->
nregs
,
0
,
0
);
stack_extend
(
mrb
,
ci
->
nregs
,
0
);
}
else
{
ci
->
nregs
=
p
->
body
.
irep
->
nregs
+
1
;
stack_extend
(
mrb
,
ci
->
nregs
,
p
->
body
.
irep
->
nlocals
,
argc
+
2
);
stack_extend
(
mrb
,
ci
->
nregs
,
argc
+
2
);
}
mrb
->
c
->
stack
[
0
]
=
self
;
...
...
@@ -683,7 +683,7 @@ RETRY_TRY_BLOCK:
if
(
!
mrb
->
c
->
stack
)
{
stack_init
(
mrb
);
}
stack_extend
(
mrb
,
irep
->
nregs
,
irep
->
nlocals
,
stack_keep
);
stack_extend
(
mrb
,
irep
->
nregs
,
stack_keep
);
mrb
->
c
->
ci
->
proc
=
proc
;
mrb
->
c
->
ci
->
nregs
=
irep
->
nregs
+
1
;
regs
=
mrb
->
c
->
stack
;
...
...
@@ -1048,11 +1048,11 @@ RETRY_TRY_BLOCK:
ci
->
nregs
=
irep
->
nregs
;
if
(
n
==
CALL_MAXARGS
)
{
ci
->
argc
=
-
1
;
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
irep
->
nlocals
,
3
);
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
3
);
}
else
{
ci
->
argc
=
n
;
stack_extend
(
mrb
,
irep
->
nregs
,
irep
->
nlocals
,
n
+
2
);
stack_extend
(
mrb
,
irep
->
nregs
,
n
+
2
);
}
regs
=
mrb
->
c
->
stack
;
pc
=
irep
->
iseq
;
...
...
@@ -1112,10 +1112,10 @@ RETRY_TRY_BLOCK:
syms
=
irep
->
syms
;
ci
->
nregs
=
irep
->
nregs
;
if
(
ci
->
argc
<
0
)
{
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
irep
->
nlocals
,
3
);
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
3
);
}
else
{
stack_extend
(
mrb
,
irep
->
nregs
,
irep
->
nlocals
,
ci
->
argc
+
2
);
stack_extend
(
mrb
,
irep
->
nregs
,
ci
->
argc
+
2
);
}
regs
=
mrb
->
c
->
stack
;
regs
[
0
]
=
m
->
env
->
stack
[
0
];
...
...
@@ -1187,10 +1187,10 @@ RETRY_TRY_BLOCK:
syms
=
irep
->
syms
;
ci
->
nregs
=
irep
->
nregs
;
if
(
n
==
CALL_MAXARGS
)
{
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
irep
->
nlocals
,
3
);
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
3
);
}
else
{
stack_extend
(
mrb
,
irep
->
nregs
,
irep
->
nlocals
,
ci
->
argc
+
2
);
stack_extend
(
mrb
,
irep
->
nregs
,
ci
->
argc
+
2
);
}
regs
=
mrb
->
c
->
stack
;
pc
=
irep
->
iseq
;
...
...
@@ -1533,10 +1533,10 @@ RETRY_TRY_BLOCK:
pool
=
irep
->
pool
;
syms
=
irep
->
syms
;
if
(
ci
->
argc
<
0
)
{
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
irep
->
nlocals
,
3
);
stack_extend
(
mrb
,
(
irep
->
nregs
<
3
)
?
3
:
irep
->
nregs
,
3
);
}
else
{
stack_extend
(
mrb
,
irep
->
nregs
,
irep
->
nlocals
,
ci
->
argc
+
2
);
stack_extend
(
mrb
,
irep
->
nregs
,
ci
->
argc
+
2
);
}
regs
=
mrb
->
c
->
stack
;
pc
=
irep
->
iseq
;
...
...
@@ -2173,7 +2173,7 @@ RETRY_TRY_BLOCK:
irep
=
p
->
body
.
irep
;
pool
=
irep
->
pool
;
syms
=
irep
->
syms
;
stack_extend
(
mrb
,
irep
->
nregs
,
irep
->
nlocals
,
1
);
stack_extend
(
mrb
,
irep
->
nregs
,
1
);
ci
->
nregs
=
irep
->
nregs
;
regs
=
mrb
->
c
->
stack
;
pc
=
irep
->
iseq
;
...
...
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