summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-04-16 11:31:50 -0600
committerKarl Williamson <public@khwilliamson.com>2012-05-23 17:34:35 -0600
commit5bfb176298d0c97bf748d42cb50b0b40fa236b70 (patch)
tree309a173f1e2fb4f257cf8f5433ba511d571deb78
parente76a8d86080608c53d4b0c32fc24294735958678 (diff)
downloadperl-5bfb176298d0c97bf748d42cb50b0b40fa236b70.tar.gz
mktables: Add error check
+= is not a commutative operator, and so the overloaded version should not accept the parameters being swapped.
-rw-r--r--lib/unicore/mktables10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 637f296f8c..b97b11f3d7 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -6812,6 +6812,16 @@ sub trace { return main::trace(@_); }
'+=' => sub {
my $self = shift;
my $other = shift;
+ my $reversed = shift;
+
+ if ($reversed) {
+ Carp::my_carp_bug("Bad news. Can't cope with '"
+ . ref($other)
+ . ' += '
+ . ref($self)
+ . "'. undef returned.");
+ return;
+ }
return if $self->carp_if_locked;