Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #42406] [PATCH] improper null testing in Parrot_instantiate_object

0 views
Skip to first unread message

Alek Storm

unread,
Apr 9, 2007, 9:25:32 PM4/9/07
to bugs-bi...@rt.perl.org
# New Ticket Created by "Alek Storm"
# Please include the string: [perl #42406]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42406 >


This patch fixes the bug in which the "init" vtable method override is
called instead of "init_pmc" when init=NULL is passed to
Parrot_instantiate_object_init, instead of init=PMCNULL. The choice
of which method to call rested on an C<if(init)> statement, which can
incorrectly return true if init == PMCNULL.

--
Alek Storm

instantiate.patch

Alek Storm

unread,
Apr 18, 2007, 4:35:44 PM4/18/07
to perl6-i...@perl.org, bugs-bi...@rt.perl.org
This patch has been sitting for over a week. Is there a problem?
It's just a bugfix.

--
Alek Storm

Alek Storm

unread,
Apr 20, 2007, 7:46:25 PM4/20/07
to parrotbug...@parrotcode.org
On 4/19/07, Allison Randal via RT <parrotbug...@parrotcode.org> wrote:
> Do you have a test case that shows where the current behavior is incorrect?

The attached test case demonstrates that passing NULL from C into PIR,
then passing that value to C<new>, causes the wrong init method to be
called. Yes, it's rare, but the patch doesn't cost anything, so it
might as well be applied. It won't matter once we get rid of the old
object system, but it makes me feel better for now :)

P.S. I picked Integer to stick foo() in arbitrarily, just to make
things simpler.

--
Alek Storm

Matt Diephouse

unread,
Apr 23, 2007, 12:56:30 AM4/23/07
to Alek Storm, parrotbug...@parrotcode.org
Alek Storm <alek....@gmail.com> wrote:
> On 4/19/07, Allison Randal via RT <parrotbug...@parrotcode.org> wrote:
> > Do you have a test case that shows where the current behavior is incorrect?
>
> The attached test case...

Looks like either (a) you forgot to attach the patch or (b) RT ate it.
Care to try again? :)

--
Matt Diephouse
http://matt.diephouse.com

Alek Storm

unread,
Apr 23, 2007, 4:31:49 PM4/23/07
to ma...@diephouse.com, parrotbug...@parrotcode.org
On 4/23/07, Matt Diephouse <mdd...@gmail.com> wrote:
> Looks like either (a) you forgot to attach the patch or (b) RT ate it.
> Care to try again? :)

Oops - looks like the former. Here we go...

--
Alek Storm

init_test.patch
0 new messages