aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-04-19 14:30:37 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-04-19 14:58:41 +0200
commitace4b1acba8dc9b54b77631d7afd146eaa992c3a (patch)
tree7839b8678755958257001059c0f34b194575c758 /gcc/d/dmd
parentdf73e5842f25aea3bab81c328ed77f16ed261b33 (diff)
downloadgcc-ace4b1acba8dc9b54b77631d7afd146eaa992c3a.zip
gcc-ace4b1acba8dc9b54b77631d7afd146eaa992c3a.tar.gz
gcc-ace4b1acba8dc9b54b77631d7afd146eaa992c3a.tar.bz2
d/dmd: Merge upstream dmd 09be6ee14
Initializes ncost before use, which was caught by valgrind. Fixes: PR d/94653 Reviewed-on: https://github.com/dlang/dmd/pull/11045
Diffstat (limited to 'gcc/d/dmd')
-rw-r--r--gcc/d/dmd/MERGE2
-rw-r--r--gcc/d/dmd/root/speller.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index dc9fb1b..2922939 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -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.
diff --git a/gcc/d/dmd/root/speller.c b/gcc/d/dmd/root/speller.c
index 2a2e6c0..e04ffb3 100644
--- a/gcc/d/dmd/root/speller.c
+++ b/gcc/d/dmd/root/speller.c
@@ -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 */