| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.516 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.3.516 |
| Problem: extend(o, o) may crash Vim. |
| Solution: Fix crash and add test. (Thinca and Hirohito Higashi) |
| Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok |
| |
| |
| |
| |
| |
| *** 10191,10197 **** |
| EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); |
| break; |
| } |
| ! else if (*action == 'f') |
| { |
| clear_tv(&di1->di_tv); |
| copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); |
| --- 10191,10197 ---- |
| EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); |
| break; |
| } |
| ! else if (*action == 'f' && HI2DI(hi2) != di1) |
| { |
| clear_tv(&di1->di_tv); |
| copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); |
| |
| |
| |
| *** 352,357 **** |
| --- 352,375 ---- |
| :let dict4copy = deepcopy(dict4) |
| :$put =(l == lcopy) |
| :$put =(dict4 == dict4copy) |
| + :" |
| + :" Pass the same List to extend() |
| + :let l = [1, 2, 3, 4, 5] |
| + :call extend(l, l) |
| + :$put =string(l) |
| + :" |
| + :" Pass the same Dict to extend() |
| + :let d = { 'a': {'b': 'B'}} |
| + :call extend(d, d) |
| + :$put =string(d) |
| + :" |
| + :" Pass the same Dict to extend() with "error" |
| + :try |
| + : call extend(d, d, "error") |
| + :catch |
| + : $put =v:exception[:15] . v:exception[-1:-1] |
| + :endtry |
| + :$put =string(d) |
| :endfun |
| :" |
| :call Test(1, 2, [3, 4], {5: 6}) " This may take a while |
| |
| |
| |
| *** 111,113 **** |
| --- 111,117 ---- |
| 0 |
| 1 |
| 1 |
| + [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] |
| + {'a': {'b': 'B'}} |
| + Vim(call):E737: a |
| + {'a': {'b': 'B'}} |
| |
| |
| |
| *** 716,717 **** |
| --- 716,719 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 516, |
| /**/ |
| |
| -- |
| I used to wonder about the meaning of life. But I looked it |
| up in the dictionary under "L" and there it was - the meaning |
| of life. It was less than I expected. - Dogbert |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |