comparison src/vim9execute.c @ 32051:e8c60d35fce3 v9.0.1357

patch 9.0.1357: using null_object results in an internal error Commit: https://github.com/vim/vim/commit/c4e1b86cb0d88fa5ec1141d3c600e026dcc1bc21 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 26 18:58:23 2023 +0000 patch 9.0.1357: using null_object results in an internal error Problem: Using null_object results in an internal error. (Ernie Rael) Solution: Add instructions for pushing an object and class. (closes https://github.com/vim/vim/issues/12044)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Feb 2023 20:00:03 +0100
parents 13329cb9faee
children 76fd08a4ae1d
comparison
equal deleted inserted replaced
32050:181589e7fc64 32051:e8c60d35fce3
1942 exec_command(isn_T *iptr) 1942 exec_command(isn_T *iptr)
1943 { 1943 {
1944 source_cookie_T cookie; 1944 source_cookie_T cookie;
1945 1945
1946 SOURCING_LNUM = iptr->isn_lnum; 1946 SOURCING_LNUM = iptr->isn_lnum;
1947 // Pass getsourceline to get an error for a missing ":end" 1947 // Pass getsourceline to get an error for a missing ":end" command.
1948 // command.
1949 CLEAR_FIELD(cookie); 1948 CLEAR_FIELD(cookie);
1950 cookie.sourcing_lnum = iptr->isn_lnum - 1; 1949 cookie.sourcing_lnum = iptr->isn_lnum - 1;
1951 if (do_cmdline(iptr->isn_arg.string, 1950 if (do_cmdline(iptr->isn_arg.string,
1952 getsourceline, &cookie, 1951 getsourceline, &cookie,
1953 DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED) == FAIL 1952 DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED) == FAIL
4016 case ISN_PUSHS: 4015 case ISN_PUSHS:
4017 case ISN_PUSHBLOB: 4016 case ISN_PUSHBLOB:
4018 case ISN_PUSHFUNC: 4017 case ISN_PUSHFUNC:
4019 case ISN_PUSHCHANNEL: 4018 case ISN_PUSHCHANNEL:
4020 case ISN_PUSHJOB: 4019 case ISN_PUSHJOB:
4020 case ISN_PUSHOBJ:
4021 case ISN_PUSHCLASS:
4021 if (GA_GROW_FAILS(&ectx->ec_stack, 1)) 4022 if (GA_GROW_FAILS(&ectx->ec_stack, 1))
4022 goto theend; 4023 goto theend;
4023 tv = STACK_TV_BOT(0); 4024 tv = STACK_TV_BOT(0);
4024 tv->v_lock = 0; 4025 tv->v_lock = 0;
4025 ++ectx->ec_stack.ga_len; 4026 ++ectx->ec_stack.ga_len;
4062 #ifdef FEAT_JOB_CHANNEL 4063 #ifdef FEAT_JOB_CHANNEL
4063 tv->v_type = VAR_JOB; 4064 tv->v_type = VAR_JOB;
4064 tv->vval.v_job = NULL; 4065 tv->vval.v_job = NULL;
4065 #endif 4066 #endif
4066 break; 4067 break;
4068 case ISN_PUSHOBJ:
4069 tv->v_type = VAR_OBJECT;
4070 tv->vval.v_object = NULL;
4071 break;
4072 case ISN_PUSHCLASS:
4073 tv->v_type = VAR_CLASS;
4074 tv->vval.v_class = iptr->isn_arg.class;
4075 break;
4067 default: 4076 default:
4068 tv->v_type = VAR_STRING; 4077 tv->v_type = VAR_STRING;
4069 tv->vval.v_string = iptr->isn_arg.string == NULL 4078 tv->vval.v_string = iptr->isn_arg.string == NULL
4070 ? NULL : vim_strsave(iptr->isn_arg.string); 4079 ? NULL : vim_strsave(iptr->isn_arg.string);
4071 } 4080 }
6659 break; 6668 break;
6660 case ISN_PUSHJOB: 6669 case ISN_PUSHJOB:
6661 #ifdef FEAT_JOB_CHANNEL 6670 #ifdef FEAT_JOB_CHANNEL
6662 smsg("%s%4d PUSHJOB \"no process\"", pfx, current); 6671 smsg("%s%4d PUSHJOB \"no process\"", pfx, current);
6663 #endif 6672 #endif
6673 break;
6674 case ISN_PUSHOBJ:
6675 smsg("%s%4d PUSHOBJ null", pfx, current);
6676 break;
6677 case ISN_PUSHCLASS:
6678 smsg("%s%4d PUSHCLASS %s", pfx, current,
6679 iptr->isn_arg.class == NULL ? "null"
6680 : (char *)iptr->isn_arg.class->class_name);
6664 break; 6681 break;
6665 case ISN_PUSHEXC: 6682 case ISN_PUSHEXC:
6666 smsg("%s%4d PUSH v:exception", pfx, current); 6683 smsg("%s%4d PUSH v:exception", pfx, current);
6667 break; 6684 break;
6668 case ISN_AUTOLOAD: 6685 case ISN_AUTOLOAD: