make reftype() consistently croak on non-refs
Gurusamy Sarathy [Fri, 17 Mar 2000 23:53:21 +0000 (23:53 +0000)]
p4raw-id: //depot/perl@5791

xsutils.c

index 02fab51..0f5989b 100644 (file)
--- a/xsutils.c
+++ b/xsutils.c
@@ -253,11 +253,7 @@ usage:
 
     rv = ST(0);
     ST(0) = TARG;
-    if (!SvOK(rv)) {
-       ST(0) = &PL_sv_no;
-       XSRETURN(1);
-    }
-    if (!SvROK(rv))
+    if (!(SvOK(rv) && SvROK(rv)))
        goto usage;
     sv = SvRV(rv);
     sv_setpv(TARG, sv_reftype(sv, 0));