mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-02 12:30:34 +00:00
Make sure to always allocate data on heap - it can get overwritten by JIT
This commit is contained in:
parent
f7b1d6c3fb
commit
3fe85c5835
@ -1783,8 +1783,8 @@ def compiler(defptr)#0
|
||||
// Free working bufffers
|
||||
//
|
||||
//heaprelease(addrxlate)
|
||||
puts("Done compiling: $"); puth(defptr=>interpaddr); putln
|
||||
getc
|
||||
//puts("Done compiling: $"); puth(defptr=>interpaddr); putln
|
||||
//getc
|
||||
return
|
||||
fin
|
||||
//if opcode == $B6; getc; fin
|
||||
|
@ -734,19 +734,21 @@ def loadcode(codefile)
|
||||
ref = fileio:open(strcat(strcpy(@filepath, cmdsys:syspath), codefile))
|
||||
//puts("ref = "); prbyte(ref); puts(" perr = "); prbyte(perr); putln
|
||||
if ref
|
||||
pcode = heapmark
|
||||
pcode = heapalloc(512)
|
||||
fileio:read(ref, pcode, 512)
|
||||
//puts("Read header bytes: "); puti(seglen)
|
||||
//if seglen == 0; puts(" perr = "); prbyte(perr); fin
|
||||
//getc; putln
|
||||
//dumpheader(pcode)
|
||||
//putname(pcode + segname + 8); putc('='); prword(pcode); putln
|
||||
heaprelease(pcode + (pcode + t_diskinfo)=>codeaddr) // REserve heap to end of buffer
|
||||
seglen = fileio:read(ref, pcode, (pcode + t_diskinfo)=>codeaddr)
|
||||
//puts("Read segment bytes: "); puti(seglen); putln
|
||||
fileio:close(ref)
|
||||
if !fp6502 and (MACHID & $F0 == $B0) // 128K Apple //e or //c
|
||||
seglen = fixup(AUXADDR, pcode + seglen - 2) - pcode
|
||||
auxmove(AUXADDR, pcode, seglen)
|
||||
heaprelease(pcode)
|
||||
pcode = AUXADDR
|
||||
else
|
||||
heaprelease(fixup(pcode, pcode + seglen - 2)) // Set heap to beginning of relocation list
|
||||
|
Loading…
x
Reference in New Issue
Block a user