comparison src/vim9compile.c @ 19223:173b99509038 v8.2.0170

patch 8.2.0170: Coverity warning for ignoring return value Commit: https://github.com/vim/vim/commit/a6d536829a2c3151f3d0faa0ecdc7b8230fb11ec Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 28 23:04:06 2020 +0100 patch 8.2.0170: Coverity warning for ignoring return value Problem: Coverity warning for ignoring return value. Solution: Check the return value and return if failed.
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Jan 2020 23:15:03 +0100
parents b18437efabac
children d776967d0f0d
comparison
equal deleted inserted replaced
19222:7bf13c862e20 19223:173b99509038
2915 2915
2916 generate_JUMP(cctx, JUMP_IF_FALSE, 0); 2916 generate_JUMP(cctx, JUMP_IF_FALSE, 0);
2917 2917
2918 // evaluate the second expression; any type is accepted 2918 // evaluate the second expression; any type is accepted
2919 *arg = skipwhite(p + 1); 2919 *arg = skipwhite(p + 1);
2920 compile_expr1(arg, cctx); 2920 if (compile_expr1(arg, cctx) == FAIL)
2921 return FAIL;
2921 2922
2922 // remember the type and drop it 2923 // remember the type and drop it
2923 --stack->ga_len; 2924 --stack->ga_len;
2924 type1 = ((type_T **)stack->ga_data)[stack->ga_len]; 2925 type1 = ((type_T **)stack->ga_data)[stack->ga_len];
2925 2926
2940 if (!VIM_ISWHITE(**arg) || !VIM_ISWHITE(p[1])) 2941 if (!VIM_ISWHITE(**arg) || !VIM_ISWHITE(p[1]))
2941 semsg(_(e_white_both), ":"); 2942 semsg(_(e_white_both), ":");
2942 2943
2943 // evaluate the third expression 2944 // evaluate the third expression
2944 *arg = skipwhite(p + 1); 2945 *arg = skipwhite(p + 1);
2945 compile_expr1(arg, cctx); 2946 if (compile_expr1(arg, cctx) == FAIL)
2947 return FAIL;
2946 2948
2947 // If the types differ, the result has a more generic type. 2949 // If the types differ, the result has a more generic type.
2948 type2 = ((type_T **)stack->ga_data)[stack->ga_len - 1]; 2950 type2 = ((type_T **)stack->ga_data)[stack->ga_len - 1];
2949 common_type(type1, type2, type2); 2951 common_type(type1, type2, type2);
2950 2952
3263 { 3265 {
3264 // for "+=", "*=", "..=" etc. first load the current value 3266 // for "+=", "*=", "..=" etc. first load the current value
3265 if (*op != '=') 3267 if (*op != '=')
3266 { 3268 {
3267 if (option) 3269 if (option)
3270 // TODO: check the option exists
3268 generate_LOAD(cctx, ISN_LOADOPT, 0, name + 1, type); 3271 generate_LOAD(cctx, ISN_LOADOPT, 0, name + 1, type);
3269 else if (global) 3272 else if (global)
3270 generate_LOAD(cctx, ISN_LOADG, 0, name + 2, type); 3273 generate_LOAD(cctx, ISN_LOADG, 0, name + 2, type);
3271 else 3274 else
3272 generate_LOAD(cctx, ISN_LOAD, idx, NULL, type); 3275 generate_LOAD(cctx, ISN_LOAD, idx, NULL, type);