Debian Codegraph @

ext/-test-/proc/super.c

raw
1 #include "ruby.h"
2
3 static VALUE
4 bug_proc_call_super(RB_BLOCK_CALL_FUNC_ARGLIST(yieldarg, procarg))
5 {
6 VALUE args[2];
7 VALUE ret;
8 args[0] = yieldarg;
9 args[1] = procarg;
10 ret = rb_call_super(2, args);
11 if (!NIL_P(blockarg)) {
12 ret = rb_proc_call(blockarg, ret);
13 }
14 return ret;
15 }
16
17 static VALUE
18 bug_proc_make_call_super(VALUE self, VALUE procarg)
19 {
20 return rb_proc_new(bug_proc_call_super, procarg);
21 }
22
23 void
24 Init_super(VALUE klass)
25 {
26 rb_define_singleton_method(klass, "make_call_super", bug_proc_make_call_super, 1);
27 }