зеркало из https://github.com/github/ruby.git
YJIT: Fixes failure reported by rails for opt+splat+rest (#7727)
This commit is contained in:
Родитель
5aa3be65f4
Коммит
293913905e
|
@ -3933,3 +3933,17 @@ assert_equal '[true, true, true, true, true]', %q{
|
|||
end
|
||||
calling_my_func
|
||||
}
|
||||
|
||||
# Regresssion test: rest and optional and splat
|
||||
assert_equal 'true', %q{
|
||||
def my_func(base=nil, *args)
|
||||
[base, args]
|
||||
end
|
||||
|
||||
def calling_my_func
|
||||
array = []
|
||||
my_func(:base, :rest1, *array) == [:base, [:rest1]]
|
||||
end
|
||||
|
||||
calling_my_func
|
||||
}
|
||||
|
|
|
@ -5855,7 +5855,7 @@ fn gen_send_iseq(
|
|||
|
||||
// If we have more arguments than required, we need to prepend
|
||||
// the items from the stack onto the array.
|
||||
let diff = (non_rest_arg_count - required_num + opts_filled_with_splat.unwrap_or(0)) as u32;
|
||||
let diff = (non_rest_arg_count - (required_num + opts_filled_with_splat.unwrap_or(0))) as u32;
|
||||
|
||||
// diff is >0 so no need to worry about null pointer
|
||||
asm.comment("load pointer to array elements");
|
||||
|
|
Загрузка…
Ссылка в новой задаче