Fix a bug I found while fixing the bug fixed in previous commit
This bug was that using a math assignment operator was allowed by fiat. This fixes that and adds a test for it. Signed-off-by: Gavin Howard <[email protected]>
This commit is contained in:
parent
f46644247f
commit
f22634b318
|
@ -1274,6 +1274,11 @@ static void bc_program_assign(BcProgram *p, uchar inst) {
|
|||
// Get the location of the string.
|
||||
BcLoc loc = bc_program_stringLoc(right, r);
|
||||
|
||||
#if BC_ENABLED
|
||||
if (inst != BC_INST_ASSIGN && inst != BC_INST_ASSIGN_NO_VAL)
|
||||
bc_err(BC_ERR_EXEC_TYPE);
|
||||
#endif // BC_ENABLED
|
||||
|
||||
// If we are assigning to an array element...
|
||||
if (left->t == BC_RESULT_ARRAY_ELEM) {
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ abs("string")
|
|||
abs(a[])
|
||||
scale("string")
|
||||
v = "s"; scale(v)
|
||||
v += "string"
|
||||
scale(b[])
|
||||
sqrt("string")
|
||||
sqrt(c[])
|
||||
|
|
Loadingâ¦
Reference in New Issue