My most recent "get tcl working again" error was in fact, the result of a bad jump, as Leo suggested. Of course, that jump was never made before, and in trying to track down why I was hitting an error condition I hadn't before, I realized that I had a few non-calling-convention subs near where the issue was occurring. In the process of updating everything to be shiny and use the very latest calling syntax (so I can then work on tracking down actual bugs somewhere), I found that the samples listed below both fail with:

7 8 nine
SArray index out of bounds!

the end of parrot -t shows:

PC=105; OP=885 (set_i_ic); ARGS=(I5=7, 10)
PC=108; OP=885 (set_i_ic); ARGS=(I0=-98, 1)
PC=111; OP=885 (set_i_ic); ARGS=(I1=3, 1)
PC=114; OP=885 (set_i_ic); ARGS=(I2=0, 0)
PC=117; OP=885 (set_i_ic); ARGS=(I3=-2, 0)
PC=120; OP=885 (set_i_ic); ARGS=(I4=0, 0)
PC=123; OP=38 (invoke_p); ARGS=(P1=RetContinuation=PMC(0x8bb7d8))
PC=48; OP=1003 (restoretop)
PC=49; OP=801 (shift_i_p); ARGS=(I16=8, P3=SArray=PMC(0x8bb7f0))

Which kind of stops me dead in my tracks, as I'm loathe to put things back to the old, bulky calling conventions.

Once this gets fixed, I'd be happy to submit a doc patch for ./imcc/docs/calling_conventions to document the syntax.

OOC, any progress on

$P1(arg)

working yet? (where $P1 is a Sub-like PMC?) This would allow me to rid my code of the "pcc_call" style entirely.

Regards.

On Sunday, November 16, 2003, at 08:03 PM, Melvin Smith wrote:

# Sample 1
.sub _main
  .local int i
  .local int j
  .local string s
  i = 7
  $I1 = 8
  s = "nine"
  I0 = _foo(7, 8, "nine")
  print "return: "
  print I0
  print "\n"
  end
.end

.sub _foo
  .param int i
  .param int j
  .param string s
  print i
  print " "
  print j
  print " "
  print s
  print "\n"
  .pcc_begin_return
  .return 10
  .pcc_end_return
.end


# Sample 2, multiple return values .sub _main .local int i .local int j .local string s i = 7 $I1 = 8 s = "nine" (I0, I1) = _foo(7, 8, "nine") print "return: " print I0 print " " print I1 print "\n" end .end

.sub _foo
  .param int i
  .param int j
  .param string s
  print i
  print " "
  print j
  print " "
  print s
  print "\n"
  .pcc_begin_return
  .return 10
  .return 11
  .pcc_end_return
.end


--
Will "Coke" Coleda will at coleda dot com




Reply via email to