diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-29 05:05:04 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-29 05:05:04 +0000 |
commit | 0b494041de37c9b7261ac5643b1b93147d3c6653 (patch) | |
tree | 592a4b7499e3d8e69662325ac459183bdf21686b /compar.c | |
parent | 54bd3c23fb8d218b3c551da89d040bf9544eae9a (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 'compar.c')
-rw-r--r-- | compar.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -32,9 +32,16 @@ rb_cmperr(VALUE x, VALUE y) } static VALUE +cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive) +{ + if (recursive) return Qfalse; + return rb_funcall2(arg1, cmp, 1, &arg2); +} + +static VALUE cmp_eq(VALUE *a) { - VALUE c = rb_funcall(a[0], cmp, 1, a[1]); + VALUE c = rb_exec_recursive_paired_outer(cmp_eq_recursive, a[0], a[1], a[1]); if (NIL_P(c)) return Qfalse; if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue; |