Permalink
Browse files

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...
Whiteknight committed May 26, 2011
1 parent 6f2f834 commit cbfc76e64acf9f0a526b5f7da0e4c6c4ec0d1189
Showing with 1 addition and 34 deletions.
  1. +0 −2 docs/embed.pod
  2. +1 −0 lib/Parrot/Vtable.pm
  3. +0 −32 t/src/extend_vtable.t
View
@@ -1025,8 +1025,6 @@ The list may also be augmented if additional functionality is required.
=item C<Parrot_PMC_delprop>
=item C<Parrot_PMC_destroy>
=item C<Parrot_PMC_divide>
=item C<Parrot_PMC_divide_float>
View
@@ -317,6 +317,7 @@ sub vtbl_embed {
}
next if $@;
next if $name eq "destroy";
my $signature = join( ', ', @sig );
my $arguments = join( ', ', @args );
View
@@ -142,38 +142,6 @@ $code
/* Some tests leave these null, so only destroy them if they aren't,
to avoid the dreaded "Null PMC access in destroy()" */
/* These still cause the above error on some platform/compiler combinations.
if ( NOT_NULL(pmc) )
Parrot_PMC_destroy(interp, pmc);
if ( NOT_NULL(pmc2) )
Parrot_PMC_destroy(interp, pmc2);
if ( NOT_NULL(pmc3) )
Parrot_PMC_destroy(interp, pmc3);
if ( NOT_NULL(pmc_string) )
Parrot_PMC_destroy(interp, pmc_string);
// This causes a double-free
if ( NOT_NULL(rpa) )
Parrot_PMC_destroy(interp, rpa);
if ( NOT_NULL(rpa2) )
Parrot_PMC_destroy(interp, rpa2);
if ( NOT_NULL(pmc_string2) )
Parrot_PMC_destroy(interp, pmc_string2);
if ( NOT_NULL(pmc_string3) )
Parrot_PMC_destroy(interp, pmc_string3);
if ( NOT_NULL(pmc_float) )
Parrot_PMC_destroy(interp, pmc_float);
if ( NOT_NULL(pmc_float2) )
Parrot_PMC_destroy(interp, pmc_float2);
if ( NOT_NULL(ns) )
Parrot_PMC_destroy(interp, ns);
if ( NOT_NULL(object) )
Parrot_PMC_destroy(interp, object);
if ( NOT_NULL(klass) )
Parrot_PMC_destroy(interp, klass);
*/
/* TODO: Properly test this */
Parrot_destroy(interp);
printf("Done!\\n");

1 comment on commit cbfc76e

@leto

This comment has been minimized.

Show comment
Hide comment
@leto

leto May 26, 2011

Member

But how will I halt and catch fire now?

Member

leto commented on cbfc76e May 26, 2011

But how will I halt and catch fire now?

Please sign in to comment.