comparison src/vim9.h @ 24796:7c1375eb1636 v8.2.2936

patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset Commit: https://github.com/vim/vim/commit/5fa9b24440d677c1aa00084d0cf84638b1e1a0d5 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 4 21:00:32 2021 +0200 patch 8.2.2936: Vim9: converting number to bool uses wrong stack offset Problem: Vim9: converting number to bool uses wrong stack offset. (Salman Halim) Solution: Include the offset in the 2BOOL command.
author Bram Moolenaar <Bram@vim.org>
date Fri, 04 Jun 2021 21:15:04 +0200
parents 668df21d8bc6
children a8d64f1a223b
comparison
equal deleted inserted replaced
24795:05a337d1fe73 24796:7c1375eb1636
146 ISN_SLICE, // drop isn_arg.number items from start of list 146 ISN_SLICE, // drop isn_arg.number items from start of list
147 ISN_BLOBAPPEND, // append to a blob, like add() 147 ISN_BLOBAPPEND, // append to a blob, like add()
148 ISN_GETITEM, // push list item, isn_arg.number is the index 148 ISN_GETITEM, // push list item, isn_arg.number is the index
149 ISN_MEMBER, // dict[member] 149 ISN_MEMBER, // dict[member]
150 ISN_STRINGMEMBER, // dict.member using isn_arg.string 150 ISN_STRINGMEMBER, // dict.member using isn_arg.string
151 ISN_2BOOL, // falsy/truthy to bool, invert if isn_arg.number != 0 151 ISN_2BOOL, // falsy/truthy to bool, uses isn_arg.tobool
152 ISN_COND2BOOL, // convert value to bool 152 ISN_COND2BOOL, // convert value to bool
153 ISN_2STRING, // convert value to string at isn_arg.number on stack 153 ISN_2STRING, // convert value to string at isn_arg.tostring on stack
154 ISN_2STRING_ANY, // like ISN_2STRING but check type 154 ISN_2STRING_ANY, // like ISN_2STRING but check type
155 ISN_NEGATENR, // apply "-" to number 155 ISN_NEGATENR, // apply "-" to number
156 156
157 ISN_CHECKNR, // check value can be used as a number 157 ISN_CHECKNR, // check value can be used as a number
158 ISN_CHECKTYPE, // check value type is isn_arg.type.ct_type 158 ISN_CHECKTYPE, // check value type is isn_arg.type.ct_type
366 366
367 // arguments to ISN_CEXPR_CORE 367 // arguments to ISN_CEXPR_CORE
368 typedef struct { 368 typedef struct {
369 cexprref_T *cexpr_ref; 369 cexprref_T *cexpr_ref;
370 } cexpr_T; 370 } cexpr_T;
371
372 // arguments to ISN_2STRING and ISN_2STRING_ANY
373 typedef struct {
374 int offset;
375 int tolerant;
376 } tostring_T;
377
378 // arguments to ISN_2BOOL
379 typedef struct {
380 int offset;
381 int invert;
382 } tobool_T;
371 383
372 /* 384 /*
373 * Instruction 385 * Instruction
374 */ 386 */
375 struct isn_S { 387 struct isn_S {
412 unpack_T unpack; 424 unpack_T unpack;
413 isn_outer_T outer; 425 isn_outer_T outer;
414 subs_T subs; 426 subs_T subs;
415 cexpr_T cexpr; 427 cexpr_T cexpr;
416 isn_T *instr; 428 isn_T *instr;
429 tostring_T tostring;
430 tobool_T tobool;
417 } isn_arg; 431 } isn_arg;
418 }; 432 };
419 433
420 /* 434 /*
421 * Info about a function defined with :def. Used in "def_functions". 435 * Info about a function defined with :def. Used in "def_functions".