Skip to content

Commit 9c8bb7c

Browse files
committed
patch 8.2.0538: Vim9: VAR_PARTIAL is not used during compilation
Problem: Vim9: VAR_PARTIAL is not used during compilation. Solution: Remove VAR_PARTIAL.
1 parent cab2767 commit 9c8bb7c

4 files changed

Lines changed: 4 additions & 48 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
538,
741743
/**/
742744
537,
743745
/**/

src/vim9.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ typedef enum {
4646
ISN_PUSHS, // push string isn_arg.string
4747
ISN_PUSHBLOB, // push blob isn_arg.blob
4848
ISN_PUSHFUNC, // push func isn_arg.string
49-
ISN_PUSHPARTIAL, // push partial ?
5049
ISN_PUSHCHANNEL, // push channel isn_arg.channel
5150
ISN_PUSHJOB, // push channel isn_arg.job
5251
ISN_NEWLIST, // push list from stack items, size is isn_arg.number
@@ -92,7 +91,6 @@ typedef enum {
9291
ISN_COMPARELIST,
9392
ISN_COMPAREDICT,
9493
ISN_COMPAREFUNC,
95-
ISN_COMPAREPARTIAL,
9694
ISN_COMPAREANY,
9795

9896
// expression operations

src/vim9compile.c

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ typval2type(typval_T *tv)
396396
if (tv->v_type == VAR_NUMBER)
397397
return &t_number;
398398
if (tv->v_type == VAR_BOOL)
399-
return &t_bool;
399+
return &t_bool; // not used
400400
if (tv->v_type == VAR_STRING)
401401
return &t_string;
402402
if (tv->v_type == VAR_LIST) // e.g. for v:oldfiles
@@ -642,7 +642,6 @@ generate_COMPARE(cctx_T *cctx, exptype_T exptype, int ic)
642642
case VAR_LIST: isntype = ISN_COMPARELIST; break;
643643
case VAR_DICT: isntype = ISN_COMPAREDICT; break;
644644
case VAR_FUNC: isntype = ISN_COMPAREFUNC; break;
645-
case VAR_PARTIAL: isntype = ISN_COMPAREPARTIAL; break;
646645
default: isntype = ISN_COMPAREANY; break;
647646
}
648647
}
@@ -879,23 +878,6 @@ generate_PUSHFUNC(cctx_T *cctx, char_u *name, type_T *type)
879878
return OK;
880879
}
881880

882-
/*
883-
* Generate an ISN_PUSHPARTIAL instruction with partial "part".
884-
* Consumes "part".
885-
*/
886-
static int
887-
generate_PUSHPARTIAL(cctx_T *cctx, partial_T *part)
888-
{
889-
isn_T *isn;
890-
891-
RETURN_OK_IF_SKIP(cctx);
892-
if ((isn = generate_instr_type(cctx, ISN_PUSHPARTIAL, &t_func_any)) == NULL)
893-
return FAIL;
894-
isn->isn_arg.partial = part;
895-
896-
return OK;
897-
}
898-
899881
/*
900882
* Generate an ISN_STORE instruction.
901883
*/
@@ -4165,9 +4147,6 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
41654147
case VAR_FUNC:
41664148
generate_PUSHFUNC(cctx, NULL, &t_func_void);
41674149
break;
4168-
case VAR_PARTIAL:
4169-
generate_PUSHPARTIAL(cctx, NULL);
4170-
break;
41714150
case VAR_LIST:
41724151
generate_NEWLIST(cctx, 0);
41734152
break;
@@ -4183,6 +4162,7 @@ compile_assignment(char_u *arg, exarg_T *eap, cmdidx_T cmdidx, cctx_T *cctx)
41834162
case VAR_NUMBER:
41844163
case VAR_UNKNOWN:
41854164
case VAR_ANY:
4165+
case VAR_PARTIAL:
41864166
case VAR_VOID:
41874167
case VAR_SPECIAL: // cannot happen
41884168
generate_PUSHNR(cctx, 0);
@@ -6018,10 +5998,6 @@ delete_instr(isn_T *isn)
60185998
blob_unref(isn->isn_arg.blob);
60195999
break;
60206000

6021-
case ISN_PUSHPARTIAL:
6022-
partial_unref(isn->isn_arg.partial);
6023-
break;
6024-
60256001
case ISN_PUSHJOB:
60266002
#ifdef FEAT_JOB_CHANNEL
60276003
job_unref(isn->isn_arg.job);
@@ -6054,7 +6030,6 @@ delete_instr(isn_T *isn)
60546030
case ISN_COMPAREFUNC:
60556031
case ISN_COMPARELIST:
60566032
case ISN_COMPARENR:
6057-
case ISN_COMPAREPARTIAL:
60586033
case ISN_COMPARESPECIAL:
60596034
case ISN_COMPARESTRING:
60606035
case ISN_CONCAT:

src/vim9execute.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ call_def_function(
858858
case ISN_PUSHS:
859859
case ISN_PUSHBLOB:
860860
case ISN_PUSHFUNC:
861-
case ISN_PUSHPARTIAL:
862861
case ISN_PUSHCHANNEL:
863862
case ISN_PUSHJOB:
864863
if (ga_grow(&ectx.ec_stack, 1) == FAIL)
@@ -896,12 +895,6 @@ call_def_function(
896895
tv->vval.v_string =
897896
vim_strsave(iptr->isn_arg.string);
898897
break;
899-
case ISN_PUSHPARTIAL:
900-
tv->v_type = VAR_PARTIAL;
901-
tv->vval.v_partial = iptr->isn_arg.partial;
902-
if (tv->vval.v_partial != NULL)
903-
++tv->vval.v_partial->pt_refcount;
904-
break;
905898
case ISN_PUSHCHANNEL:
906899
#ifdef FEAT_JOB_CHANNEL
907900
tv->v_type = VAR_CHANNEL;
@@ -1412,7 +1405,6 @@ call_def_function(
14121405
case ISN_COMPARESTRING:
14131406
case ISN_COMPAREDICT:
14141407
case ISN_COMPAREFUNC:
1415-
case ISN_COMPAREPARTIAL:
14161408
case ISN_COMPAREANY:
14171409
{
14181410
typval_T *tv1 = STACK_TV_BOT(-2);
@@ -1932,14 +1924,6 @@ ex_disassemble(exarg_T *eap)
19321924
name == NULL ? "[none]" : name);
19331925
}
19341926
break;
1935-
case ISN_PUSHPARTIAL:
1936-
{
1937-
partial_T *part = iptr->isn_arg.partial;
1938-
1939-
smsg("%4d PUSHPARTIAL \"%s\"", current,
1940-
part == NULL ? "[none]" : (char *)partial_name(part));
1941-
}
1942-
break;
19431927
case ISN_PUSHCHANNEL:
19441928
#ifdef FEAT_JOB_CHANNEL
19451929
{
@@ -2117,7 +2101,6 @@ ex_disassemble(exarg_T *eap)
21172101
case ISN_COMPARELIST:
21182102
case ISN_COMPAREDICT:
21192103
case ISN_COMPAREFUNC:
2120-
case ISN_COMPAREPARTIAL:
21212104
case ISN_COMPAREANY:
21222105
{
21232106
char *p;
@@ -2154,8 +2137,6 @@ ex_disassemble(exarg_T *eap)
21542137
case ISN_COMPARELIST: type = "COMPARELIST"; break;
21552138
case ISN_COMPAREDICT: type = "COMPAREDICT"; break;
21562139
case ISN_COMPAREFUNC: type = "COMPAREFUNC"; break;
2157-
case ISN_COMPAREPARTIAL:
2158-
type = "COMPAREPARTIAL"; break;
21592140
case ISN_COMPAREANY: type = "COMPAREANY"; break;
21602141
default: type = "???"; break;
21612142
}

0 commit comments

Comments
 (0)