On Sat, Sep 22, 2001 at 05:17:16PM +0100, Simon Cozens wrote:
> On Sat, Sep 22, 2001 at 04:40:46PM +0100, Simon Cozens wrote:
> > And now I know why! The branch-fixup section of the assembler's busted:
>
> No, that wasn't it. This is it:
>
> opcode_t *ne_nc_ic(opcode_t cur_opcode[], struct Parrot_Interp *interpreter) {
> IV return_offset = 5;
> if (NUM_REG(cur_opcode[1]) != *(NV *)&cur_opcode[2]) {
> return cur_opcode + cur_opcode[4];
>
> Now, this (and similar code) assumes that
> sizeof(NV) == 2*sizeof(opcode_t)
Baaad assumption. In Tru64 sizeof(double) is 8, sizeof(long) (IVs are
longs) is 8, too. (Just to add to the confusion, Tru64 also has long
doubles but they are only a decoy to aid compilations: they are really
the same as doubles.) (When long doubles are not decoys, they can be 12
or 16 bytes long.)
> and hence that the NV occupies cur_opcode[2] and cur_opcode[3] and the next
> thing is in cur_opcode[4]. If sizeof(NV) == sizeof(opcode_t), then the next
> thing is in cur_opcode[3].
>
> Do I have to say
> return cur_opcode + *(opcode_t*)(&cur_opcode[2] + sizeof(NV));
>
> or is there a saner way to do it?
Sorry, my caffeine intake has apparently been too low, can't think
as a C compiler right now.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen