Some patches committed last evening nearly took care of the problem -- at
least they appeared to make my small example appear to
work. Sometimes. :) Here's a slightly larger but better example that so
far hasn't failed to show the stack corruption problem anywhere:
TOKENIZER:
set S2, "one;two;three;four;five;six;seven;eight;nine;ten;eleven"
set I5, 0 # Stack pointer
set S0, "" # Accumulating here
TOKLOOP:
length I0, S2
eq I0, 0, ENDTOK # Empty yet?
substr S1, S2, 0, 1 # Peel off first character
dec I0
substr S2, S2, 1, I0
eq S1, ";", SOMETHING # Break or append chars..
concat S0, S1
branch TOKLOOP
SOMETHING:
print S0
print "<-- save ( ;boundary)\n"
savec S0
set S0, ""
inc I5
branch TOKLOOP
ENDTOK: length I0, S0
eq I0, 0, TOKBAIL
inc I5
print S0
print "<--saved (endproc)\n"
savec S0
TOKBAIL:save I5
#bsr DUMPSTACK
end