@@ -1027,6 +1027,7 @@ call_def_function(
10271027 tv = STACK_TV_BOT (idx - count );
10281028 if (tv -> v_type == VAR_CHANNEL || tv -> v_type == VAR_JOB )
10291029 {
1030+ SOURCING_LNUM = iptr -> isn_lnum ;
10301031 emsg (_ (e_inval_string ));
10311032 break ;
10321033 }
@@ -1121,6 +1122,7 @@ call_def_function(
11211122
11221123 if (di == NULL )
11231124 {
1125+ SOURCING_LNUM = iptr -> isn_lnum ;
11241126 semsg (_ (e_undefvar ), name );
11251127 goto on_error ;
11261128 }
@@ -1169,6 +1171,7 @@ call_def_function(
11691171
11701172 if (di == NULL )
11711173 {
1174+ SOURCING_LNUM = iptr -> isn_lnum ;
11721175 semsg (_ ("E121: Undefined variable: %c:%s" ),
11731176 namespace , iptr -> isn_arg .string );
11741177 goto on_error ;
@@ -1326,6 +1329,7 @@ call_def_function(
13261329 clear_tv (tv );
13271330 if (msg != NULL )
13281331 {
1332+ SOURCING_LNUM = iptr -> isn_lnum ;
13291333 emsg (_ (msg ));
13301334 goto on_error ;
13311335 }
@@ -1421,6 +1425,7 @@ call_def_function(
14211425 lidx = list -> lv_len + lidx ;
14221426 if (lidx < 0 || lidx > list -> lv_len )
14231427 {
1428+ SOURCING_LNUM = iptr -> isn_lnum ;
14241429 semsg (_ (e_listidx ), lidx );
14251430 goto on_error ;
14261431 }
@@ -1457,6 +1462,7 @@ call_def_function(
14571462
14581463 if (dict == NULL )
14591464 {
1465+ SOURCING_LNUM = iptr -> isn_lnum ;
14601466 emsg (_ (e_dictionary_not_set ));
14611467 goto on_error ;
14621468 }
@@ -1586,6 +1592,7 @@ call_def_function(
15861592 item = dict_find (dict , tv -> vval .v_string , -1 );
15871593 if (item != NULL )
15881594 {
1595+ SOURCING_LNUM = iptr -> isn_lnum ;
15891596 semsg (_ (e_duplicate_key ), tv -> vval .v_string );
15901597 dict_unref (dict );
15911598 goto on_error ;
@@ -1749,6 +1756,7 @@ call_def_function(
17491756 if (tv -> v_type == VAR_PARTIAL )
17501757 {
17511758 // TODO: use a garray_T on ectx.
1759+ SOURCING_LNUM = iptr -> isn_lnum ;
17521760 emsg ("Multiple closures not supported yet" );
17531761 goto failed ;
17541762 }
@@ -1852,6 +1860,7 @@ call_def_function(
18521860 case ISN_PUSHEXC :
18531861 if (current_exception == NULL )
18541862 {
1863+ SOURCING_LNUM = iptr -> isn_lnum ;
18551864 iemsg ("Evaluating catch while current_exception is NULL" );
18561865 goto failed ;
18571866 }
@@ -2175,7 +2184,8 @@ call_def_function(
21752184 case EXPR_DIV : f1 = f1 / f2 ; break ;
21762185 case EXPR_SUB : f1 = f1 - f2 ; break ;
21772186 case EXPR_ADD : f1 = f1 + f2 ; break ;
2178- default : emsg (_ (e_modulus ));
2187+ default : SOURCING_LNUM = iptr -> isn_lnum ;
2188+ emsg (_ (e_modulus ));
21792189 goto on_error ;
21802190 }
21812191 clear_tv (tv1 );
@@ -2228,6 +2238,7 @@ call_def_function(
22282238 tv = STACK_TV_BOT (-2 );
22292239 if (tv -> v_type != VAR_STRING )
22302240 {
2241+ SOURCING_LNUM = iptr -> isn_lnum ;
22312242 emsg (_ (e_stringreq ));
22322243 goto on_error ;
22332244 }
@@ -2236,6 +2247,7 @@ call_def_function(
22362247 tv = STACK_TV_BOT (-1 );
22372248 if (tv -> v_type != VAR_NUMBER )
22382249 {
2250+ SOURCING_LNUM = iptr -> isn_lnum ;
22392251 emsg (_ (e_number_exp ));
22402252 goto on_error ;
22412253 }
@@ -2266,6 +2278,7 @@ call_def_function(
22662278 tv = STACK_TV_BOT (-2 );
22672279 if (tv -> v_type != VAR_LIST )
22682280 {
2281+ SOURCING_LNUM = iptr -> isn_lnum ;
22692282 emsg (_ (e_listreq ));
22702283 goto on_error ;
22712284 }
@@ -2274,13 +2287,15 @@ call_def_function(
22742287 tv = STACK_TV_BOT (-1 );
22752288 if (tv -> v_type != VAR_NUMBER )
22762289 {
2290+ SOURCING_LNUM = iptr -> isn_lnum ;
22772291 emsg (_ (e_number_exp ));
22782292 goto on_error ;
22792293 }
22802294 n = tv -> vval .v_number ;
22812295 clear_tv (tv );
22822296 if ((li = list_find (list , n )) == NULL )
22832297 {
2298+ SOURCING_LNUM = iptr -> isn_lnum ;
22842299 semsg (_ (e_listidx ), n );
22852300 goto on_error ;
22862301 }
@@ -2354,6 +2369,7 @@ call_def_function(
23542369
23552370 if ((di = dict_find (dict , key , -1 )) == NULL )
23562371 {
2372+ SOURCING_LNUM = iptr -> isn_lnum ;
23572373 semsg (_ (e_dictkey ), key );
23582374 goto on_error ;
23592375 }
@@ -2378,6 +2394,7 @@ call_def_function(
23782394 tv = STACK_TV_BOT (-1 );
23792395 if (tv -> v_type != VAR_DICT || tv -> vval .v_dict == NULL )
23802396 {
2397+ SOURCING_LNUM = iptr -> isn_lnum ;
23812398 emsg (_ (e_dictreq ));
23822399 goto on_error ;
23832400 }
@@ -2386,6 +2403,7 @@ call_def_function(
23862403 if ((di = dict_find (dict , iptr -> isn_arg .string , -1 ))
23872404 == NULL )
23882405 {
2406+ SOURCING_LNUM = iptr -> isn_lnum ;
23892407 semsg (_ (e_dictkey ), iptr -> isn_arg .string );
23902408 goto on_error ;
23912409 }
@@ -2405,6 +2423,7 @@ call_def_function(
24052423#endif
24062424 )
24072425 {
2426+ SOURCING_LNUM = iptr -> isn_lnum ;
24082427 emsg (_ (e_number_exp ));
24092428 goto on_error ;
24102429 }
@@ -2441,6 +2460,7 @@ call_def_function(
24412460 || (tv -> v_type == VAR_FUNC
24422461 && ct -> ct_type == VAR_PARTIAL )))
24432462 {
2463+ SOURCING_LNUM = iptr -> isn_lnum ;
24442464 semsg (_ ("E1029: Expected %s but got %s" ),
24452465 vartype_name (ct -> ct_type ),
24462466 vartype_name (tv -> v_type ));
@@ -2461,6 +2481,7 @@ call_def_function(
24612481 || (list -> lv_len > min_len
24622482 && !iptr -> isn_arg .checklen .cl_more_OK ))
24632483 {
2484+ SOURCING_LNUM = iptr -> isn_lnum ;
24642485 semsg (_ ("E1093: Expected %d items but got %d" ),
24652486 min_len , list == NULL ? 0 : list -> lv_len );
24662487 goto on_error ;
0 commit comments