diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-01-03 19:38:24 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-01-03 19:38:24 +0000 |
commit | e5ce394ccbcb3ef5a450374c9a26bafe8a88dfa7 (patch) | |
tree | 2eeecd5b2861eda25db1850e014cd5e537cea245 | |
parent | 3b7fbd4a8e0aec57c7898a1775b0a17a345883de (diff) | |
download | perl-e5ce394ccbcb3ef5a450374c9a26bafe8a88dfa7.tar.gz |
If NV_ZERO_IS_ALLBITS_ZERO is not true, then it's important to inialise
the NV only if the new body has an NV. (D'oh!)
p4raw-id: //depot/perl@26623
-rw-r--r-- | sv.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1124,8 +1124,11 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 new_type) #ifndef NV_ZERO_IS_ALLBITS_ZERO /* If NV 0.0 is stores as all bits 0 then Zero() already creates a - * correct 0.0 for us. */ - if (old_type_details->zero_nv) + * correct 0.0 for us. Otherwise, if the old body didn't have an + * NV slot, but the new one does, then we need to initialise the + * freshly created NV slot with whatever the correct bit pattern is + * for 0.0 */ + if (old_type_details->zero_nv && !new_type_details->zero_nv) SvNV_set(sv, 0); #endif |