patch 9.1.1527: Vim9: Crash with string compound assignment
Problem: Vim9: Crash when using string compound assignment with wrong
data type (lacygoill)
Solution: verify expected member type (Hirohito Higashi)
fixes: #17675
closes: #17693
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
32a1b26ef3
commit
2ffd35fe8f
@ -3444,7 +3444,13 @@ compile_assign_compound_op(cctx_T *cctx, cac_T *cac)
|
||||
|
||||
if (*cac->cac_op == '.')
|
||||
{
|
||||
if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL)
|
||||
expected = lhs->lhs_member_type;
|
||||
stacktype = get_type_on_stack(cctx, 0);
|
||||
if (expected != &t_string
|
||||
&& need_type(stacktype, expected, FALSE, -1, 0, cctx,
|
||||
FALSE, FALSE) == FAIL)
|
||||
return FAIL;
|
||||
else if (may_generate_2STRING(-1, TOSTRING_NONE, cctx) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user