mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Don't support blockarg in opt_new
We don't calculate the correct argc so the bookkeeping slot is something else (unexpected) instead of Qnil (expected).
This commit is contained in:
parent
6052b12de4
commit
b42c8398ba
Notes:
git
2025-04-29 16:13:40 +00:00
2 changed files with 5 additions and 2 deletions
|
@ -916,11 +916,13 @@ opt_new
|
|||
VALUE argc = vm_ci_argc(cd->ci);
|
||||
VALUE val = TOPN(argc);
|
||||
|
||||
// The bookkeeping slot should be empty.
|
||||
RUBY_ASSERT(TOPN(argc + 1) == Qnil);
|
||||
|
||||
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw) && !(ruby_vm_event_flags & ISEQ_TRACE_EVENTS)) {
|
||||
RB_DEBUG_COUNTER_INC(opt_new_hit);
|
||||
val = rb_obj_alloc(val);
|
||||
TOPN(argc) = val;
|
||||
RUBY_ASSERT(TOPN(argc + 1) == Qnil);
|
||||
TOPN(argc + 1) = val;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue