#385: t/pmc/packfileconstanttable.t failure
--------------------+-------------------------------------------------------
Reporter: coke | Owner: Infinoid
Type: bug | Status: new
Priority: normal | Milestone:
Component: none | Version:
Severity: medium | Keywords:
Lang: | Patch:
Platform: |
--------------------+-------------------------------------------------------
Comment(by rg):
Replying to [comment:11 rg]:
> Since there is no such thing as a "key" register, autoconverting (if
that's even necessary) is the only possibility.
This actually made me curious. Since I've only encountered a key PMC, I
thought, maybe it really doesn't need conversion. And it seems to work.
This simple change makes the test pass again:
{{{
--- src/pmc/packfileconstanttable.pmc (revision 37330)
+++ src/pmc/packfileconstanttable.pmc (working copy)
@@ -34,7 +34,8 @@
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_OUT_OF_BOUNDS,
"Requested data out of range.");
rv = table->constants[index];
- if (rv->type != type)
+ if (rv->type != type &&
+ !(rv->type == PFC_KEY && type == PFC_PMC))
Parrot_ex_throw_from_c_args(interp, NULL,
EXCEPTION_INVALID_OPERATION,
"Requested constant of the wrong type.");
return rv;
}}}
(I hope you agree that putting this patch inline is actually easier to
use)
Could somebody a lot more knowledgeable with Parrot and Keys please check
if that's really the whole problem? FWIW it's not breaking make test and
fixing the given problem for me.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/385#comment:12>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets