From 9f36afc84cdb9a711247a9877a0081393b9269a6 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 20 Oct 2022 09:53:11 +0800 Subject: [PATCH] Check result size in op assignment. --- src/eval/stmt.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/eval/stmt.rs b/src/eval/stmt.rs index c3588754..fac3c749 100644 --- a/src/eval/stmt.rs +++ b/src/eval/stmt.rs @@ -160,7 +160,7 @@ impl Engine { match self.call_native_fn( global, caches, lib, op_assign, hash, args, true, true, *op_pos, level, ) { - Ok(_) => self.check_data_size(args[0], root.1)?, + Ok(_) => (), Err(err) if matches!(*err, ERR::ErrorFunctionNotFound(ref f, ..) if f.starts_with(op_assign)) => { // Expand to `var = var op rhs` @@ -174,6 +174,8 @@ impl Engine { } Err(err) => return Err(err), } + + self.check_data_size(args[0], root.1)?; } else { // Normal assignment *target.write_lock::().unwrap() = new_val;