1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-02-13 15:31:09 +00:00

Fix dereference from array (and found bug in dgr.pla with it)

This commit is contained in:
Dave Schmenk 2017-07-10 09:25:40 -07:00
parent 0b95baaefc
commit 976fddd094
2 changed files with 9 additions and 6 deletions

View File

@ -538,9 +538,9 @@ end
export def txtMode
^showtext
^showpage1
^ena80 = 0
^show40 = 0
^^mapmain = 0
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3on
return call($FC58, 0, 0, 0, 0) // home()
end

View File

@ -390,7 +390,10 @@ t_opseq *parse_value(t_opseq *codeseq, int rvalue, int *stackdepth)
else if (scantoken == BPTR_TOKEN || scantoken == WPTR_TOKEN)
{
deref++;
type |= scantoken == BPTR_TOKEN ? BPTR_TYPE : WPTR_TYPE;
if (!type)
type |= scantoken == BPTR_TOKEN ? BPTR_TYPE : WPTR_TYPE;
else if (scantoken == BPTR_TOKEN)
parse_error("Byte value used as pointer");
}
else if (scantoken == NEG_TOKEN || scantoken == COMP_TOKEN || scantoken == LOGIC_NOT_TOKEN)
{
@ -533,12 +536,12 @@ t_opseq *parse_value(t_opseq *codeseq, int rvalue, int *stackdepth)
if (type & (WPTR_TYPE | WORD_TYPE))
{
valseq = gen_idxw(valseq);
type = WPTR_TYPE;
type = (type & PTR_TYPE) | WORD_TYPE;
}
else
{
valseq = gen_idxb(valseq);
type = BPTR_TYPE;
type = (type & PTR_TYPE) | BYTE_TYPE;
}
}
else if (scantoken == PTRB_TOKEN || scantoken == PTRW_TOKEN)