diff options
-rw-r--r-- | jim-array.c | 3 | ||||
-rw-r--r-- | tests/dict2.test | 4 |
2 files changed, 7 insertions, 0 deletions
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); diff --git a/tests/dict2.test b/tests/dict2.test index 01826dc..2e9bcd4 100644 --- a/tests/dict2.test +++ b/tests/dict2.test @@ -120,6 +120,10 @@ test dict-3.15 {compiled dict get error cleanliness - Bug 2431847} -body { } -returnCodes error -result {key "d" not known in dictionary} test dict-3.16 {dict/list shimmering - Bug 3004007} {set l [list p 1 p 2 q 3];dict get $l q;set l} {p 1 p 2 q 3} test dict-3.17 {dict/list shimmering - Bug 3004007} {set l [list p 1 p 2 q 3];dict get $l q;llength $l} 6 +test dict-3.18 {array set non-dict get command} -constraints jim -returnCodes error -body { + set a one + array set a {a b c d} +} -result {missing value to go with key} test dict-4.1 {dict replace command} { dict replace {a b c d} |