comparison src/vim9compile.c @ 29769:e0259a817d82 v9.0.0224

patch 9.0.0224: Using NULL pointer when skipping compiled code Commit: https://github.com/vim/vim/commit/4875d6ab068f09df88d24d81de40dcd8d56e243d Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 17 15:55:51 2022 +0100 patch 9.0.0224: Using NULL pointer when skipping compiled code Problem: Using NULL pointer when skipping compiled code. Solution: Check for skipping.
author Bram Moolenaar <Bram@vim.org>
date Wed, 17 Aug 2022 17:00:05 +0200
parents c0debb5290b5
children 6b7020f3d856
comparison
equal deleted inserted replaced
29768:eda99dab5f01 29769:e0259a817d82
1163 break; 1163 break;
1164 case dest_vimvar: 1164 case dest_vimvar:
1165 generate_LOADV(cctx, name + 2); 1165 generate_LOADV(cctx, name + 2);
1166 break; 1166 break;
1167 case dest_local: 1167 case dest_local:
1168 if (lvar->lv_from_outer > 0) 1168 if (cctx->ctx_skip != SKIP_YES)
1169 generate_LOADOUTER(cctx, lvar->lv_idx, lvar->lv_from_outer, 1169 {
1170 if (lvar->lv_from_outer > 0)
1171 generate_LOADOUTER(cctx, lvar->lv_idx, lvar->lv_from_outer,
1170 type); 1172 type);
1171 else 1173 else
1172 generate_LOAD(cctx, ISN_LOAD, lvar->lv_idx, NULL, type); 1174 generate_LOAD(cctx, ISN_LOAD, lvar->lv_idx, NULL, type);
1175 }
1173 break; 1176 break;
1174 case dest_expr: 1177 case dest_expr:
1175 // list or dict value should already be on the stack. 1178 // list or dict value should already be on the stack.
1176 break; 1179 break;
1177 } 1180 }
1949 && need_type(type, &t_number, 1952 && need_type(type, &t_number,
1950 -1, 0, cctx, FALSE, FALSE) == FAIL) 1953 -1, 0, cctx, FALSE, FALSE) == FAIL)
1951 return FAIL; 1954 return FAIL;
1952 } 1955 }
1953 } 1956 }
1957
1958 if (cctx->ctx_skip == SKIP_YES)
1959 return OK;
1954 1960
1955 // Load the dict or list. On the stack we then have: 1961 // Load the dict or list. On the stack we then have:
1956 // - value (for assignment, not for :unlet) 1962 // - value (for assignment, not for :unlet)
1957 // - index 1963 // - index
1958 // - for [a : b] second index 1964 // - for [a : b] second index