diff options
author | Kenta Murata <mrkn@users.noreply.github.com> | 2020-09-16 19:27:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-16 19:27:16 +0900 |
commit | 68b5f14d536c1a81c63412a9f3701380c9bc116c (patch) | |
tree | cbd284825188b61e827fa070afa8384c0659dcb3 /complex.c | |
parent | 10290da54d04345587f63cb96ad833043e7f7f1c (diff) |
Fix assertion failed in Complex.polar without NDEBUG (#3551)
Fixes [Bug #17172].
Notes
Notes:
Merged-By: mrkn <mrkn@ruby-lang.org>
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 8 |
1 files changed, 8 insertions, 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); } |