On Wed, 9 Oct 2002, Tom Hughes wrote:
> In message <[EMAIL PROTECTED]> > Simon Glover <[EMAIL PROTECTED]> wrote: > > > This one happens because entry is a HASH_ENTRY*, but get_pmc_keyed is > > expecting a PMC*. However, by this point in the function, we've already > > verified that entry is actually a PMC*, so it should be safe to add a > > cast, as in the patch below. This shuts the warning up, and all tests > > still pass. > > I don't thnik that works. A HASH_ENTRY is not a PMC. I think you > want pass entry->val.pmc if you want the PMC stored in the hash. > I've just had a quick look at hash.h (which I should have done in the first place) and you're quite right. Second attempt at a correct patch below. All tests still pass, but this isn't much comfort, as the fact that the preceding patch 'worked' suggests that nothing's actually testing this line of code. I'll see if I can do something to remedy this tomorrow, unless somebody beats me to it. Simon --- classes/perlhash.pmc.old Wed Oct 9 15:59:29 2002 +++ classes/perlhash.pmc Wed Oct 9 18:06:08 2002 @@ -189,7 +189,7 @@ pmclass PerlHash { if (!nextkey) return entry->val.pmc_val; return entry->val.pmc_val->vtable->get_pmc_keyed(INTERP, - entry, nextkey); + (PMC*)entry->val.pmc_val, nextkey); } internal_exception(OUT_OF_BOUNDS,