aboutsummaryrefslogtreecommitdiffstats
path: root/vm_eval.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-10 22:00:11 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-13 12:16:00 +0900
commit083c5f08ec4e95c9b75810d46f933928327a5ab3 (patch)
tree2290428c880e25479df7479f7bbf457ef93abe96 /vm_eval.c
parenta5b4b806de3b130348a92aa3306fbb9318efb762 (diff)
downloadruby-083c5f08ec4e95c9b75810d46f933928327a5ab3.tar.gz
Check stack overflow in recursive glob_helper [Bug #17162]
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/vm_eval.c b/vm_eval.c
index f9e7356c30..8eb1d5c84c 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -302,6 +302,16 @@ stack_check(rb_execution_context_t *ec)
#ifndef MJIT_HEADER
+void
+rb_check_stack_overflow(void)
+{
+#ifndef RB_THREAD_LOCAL_SPECIFIER
+ if (!ruby_current_ec_key) return;
+#endif
+ rb_execution_context_t *ec = GET_EC();
+ if (ec) stack_check(ec);
+}
+
static inline const rb_callable_method_entry_t *rb_search_method_entry(VALUE recv, ID mid);
static inline enum method_missing_reason rb_method_call_status(rb_execution_context_t *ec, const rb_callable_method_entry_t *me, call_type scope, VALUE self);