mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-10 06:30:41 +00:00
Merge pull request #51 from iflan/addressing
Prefer pointer types in prefix operator parsing
This commit is contained in:
commit
522703b278
@ -651,9 +651,13 @@ t_opseq *parse_value(t_opseq *codeseq, int rvalue, int *stackdepth)
|
||||
cfnparms = 0; cfnvals = 1;
|
||||
type &= ~FUNC_TYPE;
|
||||
}
|
||||
else if (type & (BYTE_TYPE | BPTR_TYPE))
|
||||
else if (type & (BPTR_TYPE)) // Prefer the pointer type.
|
||||
valseq = gen_lb(valseq);
|
||||
else if (type & (WORD_TYPE | WPTR_TYPE))
|
||||
else if (type & (WPTR_TYPE))
|
||||
valseq = gen_lw(valseq);
|
||||
else if (type & (BYTE_TYPE))
|
||||
valseq = gen_lb(valseq);
|
||||
else if (type & (WORD_TYPE))
|
||||
valseq = gen_lw(valseq);
|
||||
else
|
||||
parse_error("What are we dereferencing?");
|
||||
|
@ -461,9 +461,13 @@ def parse_value(codeseq, r_val)#2
|
||||
valseq = gen_op(valseq, ICAL_CODE)
|
||||
stackdepth = stackdepth + cfnvals - 1
|
||||
type = type & ~FUNC_TYPE
|
||||
elsif type & (BYTE_TYPE | BPTR_TYPE)
|
||||
elsif type & (BPTR_TYPE) // Prefer the pointer type.
|
||||
valseq = gen_op(valseq, LB_CODE)
|
||||
elsif type & (WORD_TYPE | WPTR_TYPE)
|
||||
elsif type & (WPTR_TYPE)
|
||||
valseq = gen_op(valseq, LW_CODE)
|
||||
elsif type & (BYTE_TYPE)
|
||||
valseq = gen_op(valseq, LB_CODE)
|
||||
elsif type & (WORD_TYPE)
|
||||
valseq = gen_op(valseq, LW_CODE)
|
||||
else
|
||||
exit_err(ERR_INVAL|ERR_CODE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user