1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-20 13:28:56 +00:00

Sanbox broken with w->[x] = ??. plasm broken with w->2 = ??

This commit is contained in:
David Schmenk 2016-11-21 16:41:17 -08:00
parent 5e7408c980
commit bf3e1f668f
2 changed files with 13 additions and 9 deletions

View File

@ -638,13 +638,19 @@ int parse_value(int rvalue)
ref_type = (scantoken == PTRB_TOKEN) ? BPTR_TYPE : WPTR_TYPE;
if (!parse_const(&ref_offset))
scan_rewind(tokenstr);
if (ref_offset != 0)
{
emit_const(ref_offset);
emit_op(ADD_TOKEN);
ref_offset = 0;
}
break;
case DOT_TOKEN:
case COLON_TOKEN:
/*
* Structure member offset
*/
ref_type = (ref_type & (VAR_TYPE | CONST_TYPE))
ref_type = (ref_type & (VAR_TYPE | CONST_TYPE))
? ((scantoken == DOT_TOKEN) ? BYTE_TYPE : WORD_TYPE)
: ((scantoken == DOT_TOKEN) ? BPTR_TYPE : WPTR_TYPE);
if (parse_const(&const_offset))
@ -990,7 +996,7 @@ int parse_stmnt(void)
return (0);
}
}
else if (scantoken == EOL_TOKEN)
else if (scantoken == EOL_TOKEN)
{
next_line();
}
@ -1087,7 +1093,7 @@ int parse_stmnt(void)
}
if (type & LOCAL_TYPE)
(elem_type & BYTE_TYPE) ? emit_slb(addr + elem_offset) : emit_slw(addr + elem_offset);
else
else
(elem_type & BYTE_TYPE) ? emit_sab(addr, elem_offset, type) : emit_saw(addr, elem_offset, type);
break;
}
@ -1116,7 +1122,7 @@ int parse_stmnt(void)
}
}
break;
}
}
}
else if (type & FUNC_TYPE)
{
@ -1189,7 +1195,7 @@ int parse_var(int type)
long constval;
int consttype, constsize, arraysize, idlen = 0;
long size = 1;
if (scan() == OPEN_BRACKET_TOKEN)
{
size = 0;
@ -1303,7 +1309,7 @@ int parse_struc(void)
return (0);
}
scan();
}
}
}
if (type & WORD_TYPE)
size *= 2;
@ -1323,7 +1329,7 @@ int parse_vars(int type)
long value;
int idlen, size;
char *idstr;
switch (scantoken)
{
case SYSFLAGS_TOKEN:

View File

@ -3290,8 +3290,6 @@ def parse_value(rvalue)
emit_op($02)
ref_offset = 0
fin
if ref_type & BPTR_TYPE; emit_lb
elsif ref_type & WPTR_TYPE; emit_lw; fin
fin
while parse_expr
if token <> COMMA_TKN