RJIT: Properly reject keyword splat with `yield`

See the fix for YJIT.
This commit is contained in:
Alan Wu 2024-01-18 19:53:28 -05:00
Родитель bbd249e351
Коммит 7b253cfea4
3 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -4452,6 +4452,11 @@ module RubyVM::RJIT
return CantCompile
end
if flags & C::VM_CALL_KW_SPLAT != 0
asm.incr_counter(:send_iseq_kw_splat)
return CantCompile
end
if iseq_has_rest && opt_num != 0
asm.incr_counter(:send_iseq_has_rest_and_optional)
return CantCompile

Просмотреть файл

@ -69,6 +69,7 @@ RJIT_RUNTIME_COUNTERS(
send_iseq_has_rest,
send_iseq_block_arg0_splat,
send_iseq_kw_call,
send_iseq_kw_splat,
send_iseq_splat,
send_iseq_has_rest_and_optional,
send_iseq_arity_error,

Просмотреть файл

@ -1388,6 +1388,7 @@ module RubyVM::RJIT # :nodoc: all
send_iseq_has_rest: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_has_rest)")],
send_iseq_block_arg0_splat: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_block_arg0_splat)")],
send_iseq_kw_call: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_kw_call)")],
send_iseq_kw_splat: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_kw_splat)")],
send_iseq_splat: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_splat)")],
send_iseq_has_rest_and_optional: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_has_rest_and_optional)")],
send_iseq_arity_error: [CType::Immediate.parse("size_t"), Primitive.cexpr!("OFFSETOF((*((struct rb_rjit_runtime_counters *)NULL)), send_iseq_arity_error)")],