aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGavin Howard <gavin@yzena.com>2021-07-25 08:38:17 -0600
committerGavin Howard <gavin@yzena.com>2021-07-25 08:38:17 -0600
commitf22634b318527d656a0a5834fafd9e41d28ffbc1 (patch)
treecd38e1865136e441a8a9f73eb103c0c78e088400 /src
parentf46644247f95ba520e4e8938730fa35e534668ba (diff)
downloadplatform_external_bc-f22634b318527d656a0a5834fafd9e41d28ffbc1.tar.gz
platform_external_bc-f22634b318527d656a0a5834fafd9e41d28ffbc1.tar.bz2
platform_external_bc-f22634b318527d656a0a5834fafd9e41d28ffbc1.zip
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 <gavin@yzena.com>
Diffstat (limited to 'src')
-rw-r--r--src/program.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/program.c b/src/program.c
index afc48240..cd1c56c8 100644
--- a/src/program.c
+++ b/src/program.c
@@ -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) {