Mercurial > vim
comparison src/vim9compile.c @ 19876:87a66d23ccf5 v8.2.0494
patch 8.2.0494: Vim9: asan error
Commit: https://github.com/vim/vim/commit/ea94fbe83bca69eda4f03e92ecf581d0343c7b47
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 1 22:36:49 2020 +0200
patch 8.2.0494: Vim9: asan error
Problem: Vim9: asan error.
Solution: Only get the type when there is one.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 01 Apr 2020 22:45:04 +0200 |
parents | f92435f0f449 |
children | dd3c80122a0e |
comparison
equal
deleted
inserted
replaced
19875:06af496b8c4a | 19876:87a66d23ccf5 |
---|---|
3765 ++cctx->ctx_locals.ga_len; | 3765 ++cctx->ctx_locals.ga_len; |
3766 if (r == FAIL) | 3766 if (r == FAIL) |
3767 goto theend; | 3767 goto theend; |
3768 | 3768 |
3769 stack = &cctx->ctx_type_stack; | 3769 stack = &cctx->ctx_type_stack; |
3770 stacktype = ((type_T **)stack->ga_data)[stack->ga_len - 1]; | 3770 stacktype = stack->ga_len == 0 ? &t_void |
3771 : ((type_T **)stack->ga_data)[stack->ga_len - 1]; | |
3771 if (idx >= 0 && (is_decl || !has_type)) | 3772 if (idx >= 0 && (is_decl || !has_type)) |
3772 { | 3773 { |
3773 lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + idx; | 3774 lvar = ((lvar_T *)cctx->ctx_locals.ga_data) + idx; |
3774 if (!has_type) | 3775 if (!has_type) |
3775 { | 3776 { |