Leopold Toetsch wrote:
Nicholas Clark <[EMAIL PROTECTED]> wrote:On a semi-related note, there's some broken morph code in scalar. It has code like:
I'm trying to understand how morph works. perlscalar's morph looks like this:
[ broken code ]
void increment () { PMC_int_val(SELF) = DYNSELF.get_integer() + 1; }
which is then used by subclasses String, Integer and Float.
In the case of String, the get_integer succeeds, increments it and correctly puts it back, hanging off as an integer. However, the PMC's not been morphed to an Integer, so the print in the next snippet core dumps (as the integer is a union with the string address):
.sub test new $P0, .String $P0 = "12" inc $P0 print $P0 print_newline .end
Does this overlap what's being looked at, or shall I provide a patch?
Nick