Skip to content

Commit

Permalink
Merge 348187a into 44e4059
Browse files Browse the repository at this point in the history
  • Loading branch information
richardleach committed Jun 9, 2021
2 parents 44e4059 + 348187a commit 330348d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion sv.c
Expand Up @@ -9615,7 +9615,26 @@ Perl_newSVnv(pTHX_ const NV n)
SV *sv;

new_SV(sv);
sv_setnv(sv,n);
/* Inlining ONLY the small relevant subset of sv_setnv here
* for performance. */

/* We're starting from SVt_FIRST, so provided that's
* actual 0, we don't have to unset any SV type flags
* to promote to SVt_NV. */
STATIC_ASSERT_STMT(SVt_FIRST == 0);

#if NVSIZE <= IVSIZE
SET_SVANY_FOR_BODYLESS_NV(sv);
#else
SvANY(sv) = new_XNV();
#endif

SvFLAGS(sv) |= SVt_NV;
(void)SvNOK_on(sv);

SvNV_set(sv, n);
SvTAINT(sv);

return sv;
}

Expand Down

0 comments on commit 330348d

Please sign in to comment.