Mercurial > vim
comparison src/userfunc.c @ 20255:aac52c32a91f v8.2.0683
patch 8.2.0683: Vim9: parsing type does not always work
Commit: https://github.com/vim/vim/commit/5adc55cb746893c6ddf7865ff654582902dee2e3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 2 23:12:58 2020 +0200
patch 8.2.0683: Vim9: parsing type does not always work
Problem: Vim9: parsing type does not always work.
Solution: Handle func type without return value. Test more closures.
Fix type check offset. Fix garbage collection.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 02 May 2020 23:15:03 +0200 |
parents | 23d75968ca5e |
children | 683c2da4982b |
comparison
equal
deleted
inserted
replaced
20254:c7a2968adc24 | 20255:aac52c32a91f |
---|---|
4390 { | 4390 { |
4391 --todo; | 4391 --todo; |
4392 fp = HI2UF(hi); | 4392 fp = HI2UF(hi); |
4393 if (!func_name_refcount(fp->uf_name)) | 4393 if (!func_name_refcount(fp->uf_name)) |
4394 abort = abort || set_ref_in_func(NULL, fp, copyID); | 4394 abort = abort || set_ref_in_func(NULL, fp, copyID); |
4395 else if (fp->uf_dfunc_idx >= 0) | |
4396 abort = abort || set_ref_in_dfunc(fp, copyID); | |
4395 } | 4397 } |
4396 } | 4398 } |
4397 return abort; | 4399 return abort; |
4398 } | 4400 } |
4399 | 4401 |
4437 } | 4439 } |
4438 if (fp != NULL) | 4440 if (fp != NULL) |
4439 { | 4441 { |
4440 for (fc = fp->uf_scoped; fc != NULL; fc = fc->func->uf_scoped) | 4442 for (fc = fp->uf_scoped; fc != NULL; fc = fc->func->uf_scoped) |
4441 abort = abort || set_ref_in_funccal(fc, copyID); | 4443 abort = abort || set_ref_in_funccal(fc, copyID); |
4442 } | 4444 if (fp->uf_dfunc_idx >= 0) |
4445 abort = abort || set_ref_in_dfunc(fp, copyID); | |
4446 } | |
4447 | |
4443 vim_free(tofree); | 4448 vim_free(tofree); |
4444 return abort; | 4449 return abort; |
4445 } | 4450 } |
4446 | 4451 |
4447 #endif // FEAT_EVAL | 4452 #endif // FEAT_EVAL |