summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-29 05:05:04 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-29 05:05:04 +0000
commit0b494041de37c9b7261ac5643b1b93147d3c6653 (patch)
tree592a4b7499e3d8e69662325ac459183bdf21686b /thread.c
parent54bd3c23fb8d218b3c551da89d040bf9544eae9a (diff)
merge revision(s) 43208: [Backport #9003]
* compar.c (cmp_eq): fail if recursion. [ruby-core:57736] [Bug #9003] * thread.c (rb_exec_recursive_paired_outer): new function which is combinnation of paired and outer variants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 387bf1ff72..ca94cbea25 100644
--- a/thread.c
+++ b/thread.c
@@ -4376,6 +4376,18 @@ rb_clear_trace_func(void)
static void call_trace_func(rb_event_flag_t, VALUE data, VALUE self, ID id, VALUE klass);
/*
+ * If recursion is detected on the current method, obj and paired_obj,
+ * the outermost func will be called with (obj, arg, Qtrue). All inner
+ * func will be short-circuited using throw.
+ */
+
+VALUE
+rb_exec_recursive_paired_outer(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE paired_obj, VALUE arg)
+{
+ return exec_recursive(func, obj, rb_obj_id(paired_obj), arg, 1);
+}
+
+/*
* call-seq:
* set_trace_func(proc) -> proc
* set_trace_func(nil) -> nil