Re: [BUG] load_bytecode can print hello world

2004-03-11 Thread Leopold Toetsch
Jens Rieks <[EMAIL PROTECTED]> wrote:
> Hi,

> this time a funny bug :-)

> 2. create a file hello.imc with the following content:
> .emit
> .pcc_sub @LOAD _onload:
> print "foo\n"
> end
  ^^^

It's called as a PCC subroutine, so you have to return from it via
"invoke P1". I wrote that "end" is equivalent, but that's wrong. While
"end" terminates the run loop, it does *not* restore the context,
specifically, it does not restore the byte code segment (with the
constant table inside)

The code runs than on an arbitrary code position which happens to be a
print statement with constant tables swapped (print_sc has an index into
the constants) - or something like this, I didn't look further.

> jens

leo


[BUG] load_bytecode can print hello world

2004-03-10 Thread Jens Rieks
Hi,

this time a funny bug :-)

1. create a file main.imc with the following content:
.sub _main
print "A\n"
load_bytecode "hello.imc"
print "B\n"
end
.end

2. create a file hello.imc with the following content:
.emit
.pcc_sub @LOAD _onload:
print "foo\n"
end
.eom

.sub _hello
print "blah blah string\n"
load_bytecode "hello, world!\n"
end
.end

3. run main.imc

jens