comparison src/eval.c @ 1895:f637471a3607 v7.2.192

updated for version 7.2-192
author vimboss
date Wed, 03 Jun 2009 11:22:45 +0000
parents afb740b5dfab
children d8b9701a3b7b
comparison
equal deleted inserted replaced
1894:afb740b5dfab 1895:f637471a3607
6524 * with copyID. 6524 * with copyID.
6525 */ 6525 */
6526 6526
6527 /* Don't free variables in the previous_funccal list unless they are only 6527 /* Don't free variables in the previous_funccal list unless they are only
6528 * referenced through previous_funccal. This must be first, because if 6528 * referenced through previous_funccal. This must be first, because if
6529 * the item is referenced elsewhere it must not be freed. */ 6529 * the item is referenced elsewhere the funccal must not be freed. */
6530 for (fc = previous_funccal; fc != NULL; fc = fc->caller) 6530 for (fc = previous_funccal; fc != NULL; fc = fc->caller)
6531 { 6531 {
6532 set_ref_in_ht(&fc->l_vars.dv_hashtab, copyID + 1); 6532 set_ref_in_ht(&fc->l_vars.dv_hashtab, copyID + 1);
6533 set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID + 1); 6533 set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID + 1);
6534 } 6534 }
6562 } 6562 }
6563 6563
6564 /* v: vars */ 6564 /* v: vars */
6565 set_ref_in_ht(&vimvarht, copyID); 6565 set_ref_in_ht(&vimvarht, copyID);
6566 6566
6567 /* Free lists and dictionaries that are not referenced. */ 6567 /*
6568 * 2. Free lists and dictionaries that are not referenced.
6569 */
6568 did_free = free_unref_items(copyID); 6570 did_free = free_unref_items(copyID);
6569 6571
6570 /* check if any funccal can be freed now */ 6572 /*
6573 * 3. Check if any funccal can be freed now.
6574 */
6571 for (pfc = &previous_funccal; *pfc != NULL; ) 6575 for (pfc = &previous_funccal; *pfc != NULL; )
6572 { 6576 {
6573 if (can_free_funccal(*pfc, copyID)) 6577 if (can_free_funccal(*pfc, copyID))
6574 { 6578 {
6575 fc = *pfc; 6579 fc = *pfc;
9284 if (argvars[1].v_type != VAR_UNKNOWN) 9288 if (argvars[1].v_type != VAR_UNKNOWN)
9285 noref = get_tv_number_chk(&argvars[1], NULL); 9289 noref = get_tv_number_chk(&argvars[1], NULL);
9286 if (noref < 0 || noref > 1) 9290 if (noref < 0 || noref > 1)
9287 EMSG(_(e_invarg)); 9291 EMSG(_(e_invarg));
9288 else 9292 else
9289 item_copy(&argvars[0], rettv, TRUE, noref == 0 ? ++current_copyID : 0); 9293 {
9294 current_copyID += COPYID_INC;
9295 item_copy(&argvars[0], rettv, TRUE, noref == 0 ? current_copyID : 0);
9296 }
9290 } 9297 }
9291 9298
9292 /* 9299 /*
9293 * "delete()" function 9300 * "delete()" function
9294 */ 9301 */
18964 { 18971 {
18965 char_u *tofree; 18972 char_u *tofree;
18966 char_u *s; 18973 char_u *s;
18967 char_u numbuf[NUMBUFLEN]; 18974 char_u numbuf[NUMBUFLEN];
18968 18975
18969 s = echo_string(&v->di_tv, &tofree, numbuf, ++current_copyID); 18976 current_copyID += COPYID_INC;
18977 s = echo_string(&v->di_tv, &tofree, numbuf, current_copyID);
18970 list_one_var_a(prefix, v->di_key, v->di_tv.v_type, 18978 list_one_var_a(prefix, v->di_key, v->di_tv.v_type,
18971 s == NULL ? (char_u *)"" : s, first); 18979 s == NULL ? (char_u *)"" : s, first);
18972 vim_free(tofree); 18980 vim_free(tofree);
18973 } 18981 }
18974 18982
19399 if (eap->cmdidx == CMD_echo) 19407 if (eap->cmdidx == CMD_echo)
19400 msg_start(); 19408 msg_start();
19401 } 19409 }
19402 else if (eap->cmdidx == CMD_echo) 19410 else if (eap->cmdidx == CMD_echo)
19403 msg_puts_attr((char_u *)" ", echo_attr); 19411 msg_puts_attr((char_u *)" ", echo_attr);
19404 p = echo_string(&rettv, &tofree, numbuf, ++current_copyID); 19412 current_copyID += COPYID_INC;
19413 p = echo_string(&rettv, &tofree, numbuf, current_copyID);
19405 if (p != NULL) 19414 if (p != NULL)
19406 for ( ; *p != NUL && !got_int; ++p) 19415 for ( ; *p != NUL && !got_int; ++p)
19407 { 19416 {
19408 if (*p == '\n' || *p == '\r' || *p == TAB) 19417 if (*p == '\n' || *p == '\r' || *p == TAB)
19409 { 19418 {