Open toddr opened 4 years ago
An excellent argument in favour of inline functions over macros is that it avoids such stupid bugs as the always-wrong SvTRUE(POPs)
bug that I wasted about an hour on today:
https://github.com/Perl/perl5/pull/17212#discussion_r339315113
Update: Turns out you also can't use SvTRUEx(POPs)
either because on non-GNUC compilers that has to use the PL_sv
global temporary and that doesn't play nicely on threads. So we must use
{
SV *tmp = POPs;
ret = SvTRUE(tmp);
}
which would all just go away if we could define SvTRUE
as a function instead as ret = SvTRUE(POPs)
Proposed by Hugo @hvds