From: Nicholas Clark Date: Sun, 23 Dec 2007 11:27:25 +0000 (+0000) Subject: Add an assert() to verify my assumption that no-one upgrades a scalar X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69770769435281d452d003364fc4187da15cc425;p=p5sagit%2Fp5-mst-13.2.git Add an assert() to verify my assumption that no-one upgrades a scalar which has a referant but isn't flagged as a reference. p4raw-id: //depot/perl@32715 --- diff --git a/sv.c b/sv.c index bce242f..bd90934 100644 --- a/sv.c +++ b/sv.c @@ -1123,6 +1123,12 @@ Perl_sv_upgrade(pTHX_ register SV *sv, svtype new_type) if (old_type == new_type) return; + if (old_type == SVt_RV) { + /* Verify my assumption that no-one upgrades a scalar which has a + referant but isn't flagged as a reference. */ + assert(!(!SvROK(sv) && SvRV(sv))); + } + old_body = SvANY(sv); /* Copying structures onto other structures that have been neatly zeroed