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
77850056
Commit
77850056
authored
Jun 07, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend stack when pushing arguments that does not fit in; fix #4038
parent
ff0a4f78
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
mrbgems/mruby-fiber/src/fiber.c
mrbgems/mruby-fiber/src/fiber.c
+9
-9
No files found.
mrbgems/mruby-fiber/src/fiber.c
View file @
77850056
...
...
@@ -184,26 +184,27 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
{
struct
mrb_context
*
c
=
fiber_check
(
mrb
,
self
);
struct
mrb_context
*
old_c
=
mrb
->
c
;
enum
mrb_fiber_state
status
;
mrb_value
value
;
fiber_check_cfunc
(
mrb
,
c
);
if
(
resume
&&
c
->
status
==
MRB_FIBER_TRANSFERRED
)
{
status
=
c
->
status
;
if
(
resume
&&
status
==
MRB_FIBER_TRANSFERRED
)
{
mrb_raise
(
mrb
,
E_FIBER_ERROR
,
"resuming transferred fiber"
);
}
if
(
c
->
status
==
MRB_FIBER_RUNNING
||
c
->
status
==
MRB_FIBER_RESUMED
)
{
if
(
status
==
MRB_FIBER_RUNNING
||
status
==
MRB_FIBER_RESUMED
)
{
mrb_raise
(
mrb
,
E_FIBER_ERROR
,
"double resume (fib)"
);
}
if
(
c
->
status
==
MRB_FIBER_TERMINATED
)
{
if
(
status
==
MRB_FIBER_TERMINATED
)
{
mrb_raise
(
mrb
,
E_FIBER_ERROR
,
"resuming dead fiber"
);
}
mrb
->
c
->
status
=
resume
?
MRB_FIBER_RESUMED
:
MRB_FIBER_TRANSFERRED
;
old_
c
->
status
=
resume
?
MRB_FIBER_RESUMED
:
MRB_FIBER_TRANSFERRED
;
c
->
prev
=
resume
?
mrb
->
c
:
(
c
->
prev
?
c
->
prev
:
mrb
->
root_c
);
if
(
c
->
status
==
MRB_FIBER_CREATED
)
{
fiber_switch_context
(
mrb
,
c
);
if
(
status
==
MRB_FIBER_CREATED
)
{
mrb_value
*
b
,
*
e
;
if
(
len
>=
c
->
stend
-
c
->
stack
)
{
mrb_raise
(
mrb
,
E_FIBER_ERROR
,
"too many arguments to fiber"
);
}
mrb_stack_extend
(
mrb
,
len
+
2
);
/* for receiver and (optional) block */
b
=
c
->
stack
+
1
;
e
=
b
+
len
;
while
(
b
<
e
)
{
...
...
@@ -215,7 +216,6 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
else
{
value
=
fiber_result
(
mrb
,
a
,
len
);
}
fiber_switch_context
(
mrb
,
c
);
if
(
vmexec
)
{
c
->
vmexec
=
TRUE
;
...
...
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