summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f118d57c60..f512832a30 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4087,8 +4087,12 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other)
if (SvGMAGICAL(e))
e = sv_mortalcopy(e);
- if (SM_OBJECT)
- Perl_croak(aTHX_ "Smart matching a non-overloaded object breaks encapsulation");
+ if (SM_OBJECT) {
+ if (!SvOK(d) || !SvOK(e))
+ RETPUSHNO;
+ else
+ Perl_croak(aTHX_ "Smart matching a non-overloaded object breaks encapsulation");
+ }
if (SM_CV_NEP) {
I32 c;