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
ae44e806
Commit
ae44e806
authored
Dec 06, 2017
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit `ecall()` depth to 32 (default).
parent
b00d45b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/vm.c
src/vm.c
+6
-1
No files found.
src/vm.c
View file @
ae44e806
...
...
@@ -53,6 +53,11 @@ void abort(void);
#define MRB_FUNCALL_DEPTH_MAX 512
#endif
/* Maximum depth of ecall() recursion. */
#ifndef MRB_ECALL_DEPTH_MAX
#define MRB_ECALL_DEPTH_MAX 32
#endif
/* Maximum stack depth. Should be set lower on memory constrained systems.
The value below allows about 60000 recursive calls in the simplest case. */
#ifndef MRB_STACK_MAX
...
...
@@ -319,7 +324,7 @@ ecall(mrb_state *mrb)
int
nregs
;
if
(
i
<
0
)
return
;
if
(
ci
-
c
->
cibase
>
MRB_
FUN
CALL_DEPTH_MAX
)
{
if
(
ci
-
c
->
cibase
>
MRB_
E
CALL_DEPTH_MAX
)
{
mrb_exc_raise
(
mrb
,
mrb_obj_value
(
mrb
->
stack_err
));
}
p
=
c
->
ensure
[
i
];
...
...
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