Skip to content
This repository
Browse code

Nuke Parrot_PMC_destroy. It's an extremely dangerous function that sh…

…ould *ABSOLUTELY NEVER BE CALLED BY ANYBODY EVER*. Seriously. Re-read that.
  • Loading branch information...
commit cbfc76e64acf9f0a526b5f7da0e4c6c4ec0d1189 1 parent 6f2f834
Andrew Whitworth authored May 26, 2011
2  docs/embed.pod
Source Rendered
@@ -1025,8 +1025,6 @@ The list may also be augmented if additional functionality is required.
1025 1025
 
1026 1026
 =item C<Parrot_PMC_delprop>
1027 1027
 
1028  
-=item C<Parrot_PMC_destroy>
1029  
-
1030 1028
 =item C<Parrot_PMC_divide>
1031 1029
 
1032 1030
 =item C<Parrot_PMC_divide_float>
1  lib/Parrot/Vtable.pm
@@ -317,6 +317,7 @@ sub vtbl_embed {
317 317
         }
318 318
 
319 319
         next if $@;
  320
+        next if $name eq "destroy";
320 321
 
321 322
         my $signature = join( ', ', @sig );
322 323
         my $arguments = join( ', ', @args );
32  t/src/extend_vtable.t
@@ -142,38 +142,6 @@ $code
142 142
     /* Some tests leave these null, so only destroy them if they aren't,
143 143
        to avoid the dreaded "Null PMC access in destroy()" */
144 144
 
145  
-    /* These still cause the above error on some platform/compiler combinations.
146  
-    if ( NOT_NULL(pmc) )
147  
-        Parrot_PMC_destroy(interp, pmc);
148  
-    if ( NOT_NULL(pmc2) )
149  
-        Parrot_PMC_destroy(interp, pmc2);
150  
-    if ( NOT_NULL(pmc3) )
151  
-        Parrot_PMC_destroy(interp, pmc3);
152  
-    if ( NOT_NULL(pmc_string) )
153  
-        Parrot_PMC_destroy(interp, pmc_string);
154  
-
155  
-    // This causes a double-free
156  
-    if ( NOT_NULL(rpa) )
157  
-        Parrot_PMC_destroy(interp, rpa);
158  
-    if ( NOT_NULL(rpa2) )
159  
-        Parrot_PMC_destroy(interp, rpa2);
160  
-
161  
-    if ( NOT_NULL(pmc_string2) )
162  
-        Parrot_PMC_destroy(interp, pmc_string2);
163  
-    if ( NOT_NULL(pmc_string3) )
164  
-        Parrot_PMC_destroy(interp, pmc_string3);
165  
-    if ( NOT_NULL(pmc_float) )
166  
-        Parrot_PMC_destroy(interp, pmc_float);
167  
-    if ( NOT_NULL(pmc_float2) )
168  
-        Parrot_PMC_destroy(interp, pmc_float2);
169  
-    if ( NOT_NULL(ns) )
170  
-        Parrot_PMC_destroy(interp, ns);
171  
-    if ( NOT_NULL(object) )
172  
-        Parrot_PMC_destroy(interp, object);
173  
-    if ( NOT_NULL(klass) )
174  
-        Parrot_PMC_destroy(interp, klass);
175  
-    */
176  
-
177 145
     /* TODO: Properly test this */
178 146
     Parrot_destroy(interp);
179 147
     printf("Done!\\n");

1 note on commit cbfc76e

Duke Leto
Owner
leto commented on cbfc76e May 26, 2011

But how will I halt and catch fire now?

Please sign in to comment.
Something went wrong with that request. Please try again.