On Aug 20, 2007, at 7:10 PM, chromatic (via RT) wrote:

# New Ticket Created by  chromatic
# Please include the string:  [perl #44811]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44811 >


Test 91 fails at this PASM with the -j flat on x86 Linux:

# An empty register should be false...
        clears
        if      S1, BAD10
        branch  OK10
BAD10:. print.  "not "
OK10:.  print.  "ok 10\n"

.   end

The problem *appears* to be an assertion in string_bool() failing, because the
string is null.  The appropriate if opcode is:

opcode_t *
Parrot_if_s_ic (opcode_t *cur_opcode, PARROT_INTERP)  {
#line 317 "src/ops/core.ops"
    if (SREG(1) && string_bool(interp, SREG(1))) {
        return (opcode_t *)cur_opcode + cur_opcode[2];
    }
    return (opcode_t *)cur_opcode + 3;
}

The null test is important there. The relevant op in the JIT (at least for x86) appears not to make the null test, so the call continues as normal.

I'm not a good enough x86 assembly programmer to fix things (I think the right code is to load the string pointer into a register, compare it to zero, and jump past the current opcode, but as for how to do that, I'm not sure), but
it looks like an easy fix.

-- c


Just out of curiosity, why not make string_bool accept a null pointer? It at least seems to make sense to me. Plus it would be easier than fixing the jit.

Reply via email to