Skip to content

Commit

Permalink
Nuke Parrot_PMC_destroy. It's an extremely dangerous function that sh…
Browse files Browse the repository at this point in the history
…ould *ABSOLUTELY NEVER BE CALLED BY ANYBODY EVER*. Seriously. Re-read that.
  • Loading branch information
Whiteknight committed May 26, 2011
1 parent 6f2f834 commit cbfc76e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
2 changes: 0 additions & 2 deletions docs/embed.pod
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions lib/Parrot/Vtable.pm
Expand Up @@ -317,6 +317,7 @@ sub vtbl_embed {
}

next if $@;
next if $name eq "destroy";

my $signature = join( ', ', @sig );
my $arguments = join( ', ', @args );
Expand Down
32 changes: 0 additions & 32 deletions t/src/extend_vtable.t
Expand Up @@ -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");
Expand Down

1 comment on commit cbfc76e

@leto
Copy link
Member

@leto leto commented on cbfc76e May 26, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But how will I halt and catch fire now?

Please sign in to comment.