Dan Sugalski wrote:
At 10:56 AM +0100 12/21/04, Leopold Toetsch wrote:

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.


Yep, that's it. Going back a page or so I see this is triggered by some math, and I assume that something's not preserving the N registers as part of the dispatch in there somewhere. I'll see about poking around the code and tracking it down tomorrow unless someone beats me to it.

You must have some additional features" in that piece of code. The example below does preserve N5 around the overloaded object access. But maybe you can extend it to what your code is doing at the failing place.


leo

.sub main
    .local pmc cl, o, p, q
    N5 = 100.0
    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"
    print N5
    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