Change 27542 by [EMAIL PROTECTED] on 2006/03/19 16:38:11

        Subject: [PATCH] Change the semantics of S_isa_lookup
        From: Andy Lester <[EMAIL PROTECTED]>
        Date: Sat, 18 Mar 2006 00:28:45 -0600
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/embed.fnc#334 edit
... //depot/perl/proto.h#681 edit
... //depot/perl/universal.c#139 edit

Differences ...

==== //depot/perl/embed.fnc#334 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#333~27534~   2006-03-17 07:58:45.000000000 -0800
+++ perl/embed.fnc      2006-03-19 08:38:11.000000000 -0800
@@ -1431,7 +1431,7 @@
 #endif
 
 #if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-s      |SV*|isa_lookup |NULLOK HV *stash|NN const char *name|NULLOK HV 
*name_stash|int len|int level
+s      |bool|isa_lookup        |NULLOK HV *stash|NN const char *name|NULLOK HV 
*name_stash|int len|int level
 #endif
 
 #if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)

==== //depot/perl/proto.h#681 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#680~27534~     2006-03-17 07:58:45.000000000 -0800
+++ perl/proto.h        2006-03-19 08:38:11.000000000 -0800
@@ -3904,7 +3904,7 @@
 #endif
 
 #if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-STATIC SV*     S_isa_lookup(pTHX_ HV *stash, const char *name, HV *name_stash, 
int len, int level)
+STATIC bool    S_isa_lookup(pTHX_ HV *stash, const char *name, HV *name_stash, 
int len, int level)
                        __attribute__nonnull__(pTHX_2);
 
 #endif

==== //depot/perl/universal.c#139 (text) ====
Index: perl/universal.c
--- perl/universal.c#138~27300~ 2006-02-24 02:41:53.000000000 -0800
+++ perl/universal.c    2006-03-19 08:38:11.000000000 -0800
@@ -31,7 +31,7 @@
  * The main guts of traverse_isa was actually copied from gv_fetchmeth
  */
 
-STATIC SV *
+STATIC bool
 S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
              int len, int level)
 {
@@ -46,15 +46,15 @@
     /* A stash/class can go by many names (ie. User == main::User), so 
        we compare the stash itself just in case */
     if (name_stash && (stash == name_stash))
-        return &PL_sv_yes;
+        return TRUE;
 
     hvname = HvNAME_get(stash);
 
     if (strEQ(hvname, name))
-       return &PL_sv_yes;
+       return TRUE;
 
     if (strEQ(name, "UNIVERSAL"))
-       return &PL_sv_yes;
+       return TRUE;
 
     if (level > 100)
        Perl_croak(aTHX_ "Recursive inheritance detected in package '%s'",
@@ -71,7 +71,7 @@
            if (svp && (sv = *svp) != (SV*)&PL_sv_undef) {
                DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n",
                                  name, hvname) );
-               return sv;
+               return (sv == &PL_sv_yes);
            }
        }
        else {
@@ -114,16 +114,15 @@
                                    sv, hvname);
                    continue;
                }
-               if (&PL_sv_yes == isa_lookup(basestash, name, name_stash, 
-                                             len, level + 1)) {
+               if (isa_lookup(basestash, name, name_stash, len, level + 1)) {
                    (void)hv_store(hv,name,len,&PL_sv_yes,0);
-                   return &PL_sv_yes;
+                   return TRUE;
                }
            }
            (void)hv_store(hv,name,len,&PL_sv_no,0);
        }
     }
-    return &PL_sv_no;
+    return FALSE;
 }
 
 /*
@@ -160,7 +159,7 @@
 
     if (stash) {
        HV * const name_stash = gv_stashpv(name, FALSE);
-       return isa_lookup(stash, name, name_stash, strlen(name), 0) == 
&PL_sv_yes;
+       return isa_lookup(stash, name, name_stash, strlen(name), 0);
     }
     else
        return FALSE;
End of Patch.

Reply via email to