# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #35944]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=35944 >


Leo's recent patches to <compile> seem to have improved the state of affairs, 
but I'm still having difficulty with tcl's <compile>r. The attached is a 
simplified version that exhibits the same problems I'm experiencing.

Attached find a test for <compile>rs written in PIR. (very simple compiler. 
takes a string and prints it out with a trailing newline.)

While I expect it to print "ok 1", it instead prints:

Null PMC access in invoke()
current instr.: 'main' pc 50 (compile.pir:8)
.sub main @MAIN
  register_compiler()

  .local pmc compiler, invokable
  compiler = compreg "PUTS"

  invokable = compile compiler, "ok 1"
  invokable()

.end

.sub register_compiler
  $P0 = find_global "puts"
  compreg "PUTS", $P0
.end

.sub puts
  .param string printme

  .local pmc pasm_compiler, retval
  pasm_compiler = compreg "PASM" 
  
  .local string code

  code .= "print \""
  code .= printme
  code .= "\\n\"\n"

  retval = compile pasm_compiler, code

  .return (retval)
.end

Reply via email to