summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-11-28 09:08:09 +0000
committerDavid Mitchell <davem@iabyn.com>2017-11-28 09:23:57 +0000
commitd7e75038064881b413f76de9315a5acfb21472f0 (patch)
treecab03635d72d7d1624a57406fb4192ea5b3df10d /pp_hot.c
parent04139aa0b51c7b5d9f80f77b10f85ce4c65a4cf6 (diff)
downloadperl-d7e75038064881b413f76de9315a5acfb21472f0.tar.gz
$overloaded .= $x: don't stringify $x
RT #132385 This is a variant of the ($ref . $overloaded) bug which was fixed with v5.27.5-195-gb3ab0375cb. Basically, when the overloaded concat method is called, it should pass $x as-is, rather than as "$x". This fixes PDL-2.018
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index d1d02257ed..7609638b8f 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -661,6 +661,19 @@ PP(pp_multiconcat)
*/
assert(!targ_chain);
dsv = newSVpvn_flags("", 0, SVs_TEMP);
+
+ if ( svpv_end == svpv_buf + 1
+ /* no const string segments */
+ && aux[PERL_MULTICONCAT_IX_LENGTHS].ssize == -1
+ ) {
+ /* special case $overloaded .= $arg1:
+ * avoid stringifying $arg1.
+ * Similar to the $arg1 . $arg2 case in phase1
+ */
+ svpv_end--;
+ SP--;
+ }
+
goto phase3;
}
}