From: Nicholas Clark <nick@ccl4.org>
Date: Wed, 15 Jun 2005 22:32:14 +0000 (+0000)
Subject: Don't write bytecode to load the NVX of AVs and HVs
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fefd4cb95a81f68cb9cd0a98a93d0e52743fae98;p=p5sagit%2Fp5-mst-13.2.git

Don't write bytecode to load the NVX of AVs and HVs

p4raw-id: //depot/perl@24859
---

diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm
index a6cf550..b60651a 100644
--- a/ext/B/B/Bytecode.pm
+++ b/ext/B/B/Bytecode.pm
@@ -240,6 +240,13 @@ sub B::PVIV::bsave {
 sub B::PVNV::bsave {
     my ($sv,$ix) = @_;
     $sv->B::PVIV::bsave($ix);
+    # Magical AVs end up here, but AVs now don't have an NV slot actually
+    # allocated. Hence don't write out assembly to store the NV slot if we're
+    # actually an array.
+    return if $sv->isa('B::AV');
+    # Likewise HVs have no NV slot actually allocated.
+    # I don't think that they can get here, but better safe than sorry
+    return if $sv->isa('B::HV');
     asm "xnv", sprintf "%.40g", $sv->NVX;
 }