Dan Sugalski (via RT) wrote:

You'll note that N5 is set to 22253 when the returncc's done, but after the return the value is -21814.6. Looks like something's stomping the N registers.

The program below shows exactly the same behavior WRT __set_number_native. The call comes from inside of the mmd_fallback function, so I presume that in the part before the shown trace you are having some kind of mathematical operation that leads to the change in N5.


leo

.sub main
    .local pmc cl, o, p, q
    newclass cl, "money"
    addattribute cl, "n"
    o = new "money"
    p = new "money"
    q = new "money"
    o = 2.0
    p = 3.0
    q = o + p
    print q
    print "\n"
.end
.namespace ["money"]
.sub __init method
    $P0 = new Float
    setattribute self, "money\0n", $P0
.end
.sub __set_number_native method
    .param float n
    $P0 = getattribute self, "money\0n"
    $P0 = n
.end
.sub __get_string method
    $P0 = getattribute self, "money\0n"
    $S0 = $P0
    .return($S0)
.end
.sub __get_number method
    $P0 = getattribute self, "money\0n"
    $N0 = $P0
    .return($N0)
.end





Reply via email to