mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix assertion failed in Complex.polar without NDEBUG (#3551)
Fixes [Bug #17172].
This commit is contained in:
parent
10290da54d
commit
68b5f14d53
Notes:
git
2020-09-16 19:27:40 +09:00
Merged-By: mrkn <mrkn@ruby-lang.org>
2 changed files with 13 additions and 0 deletions
|
@ -732,6 +732,14 @@ nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
|
|||
nucomp_real_check(arg);
|
||||
break;
|
||||
}
|
||||
if (RB_TYPE_P(abs, T_COMPLEX)) {
|
||||
get_dat1(abs);
|
||||
abs = dat->real;
|
||||
}
|
||||
if (RB_TYPE_P(arg, T_COMPLEX)) {
|
||||
get_dat1(arg);
|
||||
arg = dat->real;
|
||||
}
|
||||
return f_complex_polar(klass, abs, arg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue