Attached, find the definition for __var_subst, and the one function it calls, __cmd_set (and the one macro /that/ includes, debug.)
(There are some commented out calls to _dumper (for printing out the contents of aggegrate PMCs), but the trouncing occurs without them.)
var_subst.imc
Description: Binary data
set.imc
Description: Binary data
debug.imc
Description: Binary data
On Sunday, January 25, 2004, at 02:28 AM, Luke Palmer wrote:
Will Coleda writes:--I'm trying to track down a problem with a PerlArray that is getting modified on me.
I have a snippet of code like:
typeof $S12, tcl_words $I12 = tcl_words print "TYPEOF: " print $S12 print "\n" print "SIZEOF: " print $I12 print "\n" (var_start_at,var_length,var_replace_str) = __var_subst(var_current_word) typeof $S12, tcl_words $I12 = tcl_words print "TYPEOF: " print $S12 print "\n" print "SIZEOF: " print $I12 print "\n"
Which is displaying:
TYPEOF: PerlArray SIZEOF: 7 TYPEOF: PerlArray SIZEOF: 1
if I do a saveall/restoreall around the call to __var_subst, then I get
the expected:
TYPEOF: PerlArray SIZEOF: 7 TYPEOF: PerlArray SIZEOF: 7
But then my return values are trounced.
Is this a bug, or just a misunderstanding on my part?
It looks okay to me, but that depends on what __var_subst actually does.
Any continuation magic could make this choke. What if you try a
savetop/restoretop instead? I'm not sure if that works, because I'm not
sure whether IMCC moves return values into high registers after a call.
Or you could use the user stack to save your return values.
Of course these are temporary fixes. I'd like to see the code of __var_subst, and perhaps a few functions that it in turn calls, if any.
Luke
Will "Coke" Coleda will at coleda dot com