mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Revert "vm.c (mrb_funcall_with_block): avoid use of MRB_METHOD_CFUNC_P()."
This reverts commit c28ac75a87.
This change caused SEGV in the case like the following:
```
class C
class << self
attr_accessor :a
alias :const_missing :a=
end
end
p C::CONST
```
This commit is contained in:
@@ -664,7 +664,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc
|
||||
ci->mid = mid;
|
||||
ci->proc = MRB_METHOD_PROC_P(m) ? MRB_METHOD_PROC(m) : NULL;
|
||||
|
||||
if (ci->proc == NULL) {
|
||||
if (MRB_METHOD_CFUNC_P(m)) {
|
||||
ci->stack[0] = self;
|
||||
val = MRB_METHOD_CFUNC(m)(mrb, self);
|
||||
cipop(mrb);
|
||||
|
||||
Reference in New Issue
Block a user