]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d/dmd: Merge upstream dmd 09be6ee14
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 19 Apr 2020 12:30:37 +0000 (14:30 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 19 Apr 2020 12:58:41 +0000 (14:58 +0200)
Initializes ncost before use, which was caught by valgrind.

Fixes: PR d/94653
Reviewed-on: https://github.com/dlang/dmd/pull/11045

gcc/d/dmd/MERGE
gcc/d/dmd/root/speller.c

index dc9fb1b8d97100d2ccafaa65184d2426e2a39d71..2922939a2da5efc8fab78a41a73d2766e4237bb5 100644 (file)
@@ -1,4 +1,4 @@
-799066f498aebcfa420df284cac1f204b1f953a8
+09be6ee1439ba12211678f3f1b591d1e986b7be0
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
index 2a2e6c015c1444754e19f06fb2df0136f08d55c1..e04ffb38067fc4efdba8857d0c4785ce9fa86dcc 100644 (file)
@@ -58,7 +58,7 @@ void *spellerY(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg,
     memcpy(buf, seed, index);
     *cost = INT_MAX;
     void* p = NULL;
-    int ncost;
+    int ncost = 0;
 
     /* Delete at seed[index] */
     if (index < seedlen)
@@ -122,7 +122,7 @@ void *spellerX(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg,
         if (!buf)
             return NULL;                      // no matches
     }
-    int cost = INT_MAX, ncost;
+    int cost = INT_MAX, ncost = 0;
     void *p = NULL, *np;
 
     /* Deletions */