From 93ea2fcea92f79350067d684b29e520eff8eabe8 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 12 Jan 2014 20:38:03 +1000 Subject: array: array set to non-dict should fail Currently returns the error message but does not set JIM_ERR Also add a test case Signed-off-by: Steve Bennett --- jim-array.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'jim-array.c') diff --git a/jim-array.c b/jim-array.c index 3bb74c6..bf07e07 100644 --- a/jim-array.c +++ b/jim-array.c @@ -174,6 +174,9 @@ static int array_cmd_set(Jim_Interp *interp, int argc, Jim_Obj *const *argv) /* Doesn't exist, so just set the list directly */ return Jim_SetVariable(interp, argv[0], listObj); } + else if (Jim_DictSize(interp, dictObj) < 0) { + return JIM_ERR; + } if (Jim_IsShared(dictObj)) { dictObj = Jim_DuplicateObj(interp, dictObj); -- cgit v1.1