Skip to content

Commit

Permalink
Merge b8be8b3 into 08e4a1e
Browse files Browse the repository at this point in the history
  • Loading branch information
richardleach committed May 28, 2021
2 parents 08e4a1e + b8be8b3 commit 55ecb98
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_IV. */
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 55ecb98

Please sign in to comment.