develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35215 - branches/rvar2/src/pmc

From:
jonathan
Date:
January 8, 2009 09:45
Subject:
[svn:parrot] r35215 - branches/rvar2/src/pmc
Message ID:
20090108174527.331CDCB9F9@x12.develooper.com
Author: jonathan
Date: Thu Jan  8 09:45:26 2009
New Revision: 35215

Modified:
   branches/rvar2/src/pmc/sub.pmc

Log:
[core] Add missing null check (string_copy is marked as not expecting a NULL).

Modified: branches/rvar2/src/pmc/sub.pmc
==============================================================================
--- branches/rvar2/src/pmc/sub.pmc	(original)
+++ branches/rvar2/src/pmc/sub.pmc	Thu Jan  8 09:45:26 2009
@@ -385,7 +385,8 @@
         PMC_struct_val(ret) = sub;
         PMC_pmc_val(ret)    = NULL;
         memcpy(sub, PMC_sub(SELF), sizeof (Parrot_sub));
-        sub->name           = string_copy(INTERP, sub->name);
+        if (sub->name != NULL)
+            sub->name = string_copy(INTERP, sub->name);
 
         if (sub->ctx)
             Parrot_context_ref(INTERP, sub->ctx);



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About