summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-06-29 00:38:04 -0500
committerJesse Luehrs <doy@tozt.net>2012-06-29 00:46:57 -0500
commit386a54892347d3298ba7f1e98f207e36bc4f3424 (patch)
tree9aa57403efdddc7d93295f6365c7e9a34142ba8f /gv.c
parentaf41786fe5732d5ec7932b946eec99a695ac6e43 (diff)
downloadperl-386a54892347d3298ba7f1e98f207e36bc4f3424.tar.gz
"use overload fallback => 0" should enable overloading [perl #113010]
This makes package Foo; use overload fallback => 0; and package Bar; use overload '+' => \&add, fallback => 0; behave identically when an operator other than '+' is used.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index c4089cd123..8251c29a68 100644
--- a/gv.c
+++ b/gv.c
@@ -2274,10 +2274,16 @@ Perl_Gv_AMupdate(pTHX_ HV *stash, bool destructing)
NOOP; /* Equivalent to !SvTRUE and !SvOK */
}
#endif
- else if (SvTRUE(sv))
+ else if (SvTRUE(sv)) {
amt.fallback=AMGfallYES;
- else if (SvOK(sv))
+ filled = 1;
+ have_ovl = 1;
+ }
+ else if (SvOK(sv)) {
amt.fallback=AMGfallNEVER;
+ filled = 1;
+ have_ovl = 1;
+ }
for (i = 1; i < lim; i++)
amt.table[i] = NULL;