]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0904: Vim9: copy-paste error in class_defining_member() v9.1.0904
authorZdenek Dohnal <zdohnal@redhat.com>
Wed, 4 Dec 2024 19:19:40 +0000 (20:19 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 4 Dec 2024 19:19:40 +0000 (20:19 +0100)
Problem:  Vim9: copy-paste error in class_defining_member()
Solution: use variable type VAR_CLASS instead (Zdenek Dohnal)

Found issue by OpenScanHub:
Error: COPY_PASTE_ERROR (CWE-398):
vim91/src/vim9class.c:3308: original: "VAR_OBJECT" looks like the
original copy.
vim91/src/vim9class.c:3316: copy_paste_error: "VAR_OBJECT" looks like a
copy-paste error.
vim91/src/vim9class.c:3316: remediation: Should it say "VAR_CLASS"
instead?
3314|             {
3315|                 cl_tmp = super;
3316|->               vartype = VAR_OBJECT;
3317|             }
3318|         }

closes: #16163

Signed-off-by: Zdenek Dohnal <zdohnal@redhat.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/version.c
src/vim9class.c

index 95d4cc1a10654c751dd6a43f2c4796749b698fe7..42d8e1182ba3dce431327f1fc23921737c3d8ce0 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    904,
 /**/
     903,
 /**/
index d0ddcb8209de32e203dd7c9759030ac1ef373cb4..e85cf827f3b167354bee94e39cd39fabd4541a37 100644 (file)
@@ -3313,7 +3313,7 @@ class_defining_member(class_T *cl, char_u *name, size_t len, ocmember_T **p_m)
            if (( m = class_member_lookup(super, name, len, NULL)) != NULL)
            {
                cl_tmp = super;
-               vartype = VAR_OBJECT;
+               vartype = VAR_CLASS;
            }
        }
        if (cl_tmp == NULL)