Commit ace4b1ac by Iain Buclaw

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
parent df73e584
799066f498aebcfa420df284cac1f204b1f953a8 09be6ee1439ba12211678f3f1b591d1e986b7be0
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository. merge done from the dlang/dmd repository.
...@@ -58,7 +58,7 @@ void *spellerY(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg, ...@@ -58,7 +58,7 @@ void *spellerY(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg,
memcpy(buf, seed, index); memcpy(buf, seed, index);
*cost = INT_MAX; *cost = INT_MAX;
void* p = NULL; void* p = NULL;
int ncost; int ncost = 0;
/* Delete at seed[index] */ /* Delete at seed[index] */
if (index < seedlen) if (index < seedlen)
...@@ -122,7 +122,7 @@ void *spellerX(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg, ...@@ -122,7 +122,7 @@ void *spellerX(const char *seed, size_t seedlen, fp_speller_t fp, void *fparg,
if (!buf) if (!buf)
return NULL; // no matches return NULL; // no matches
} }
int cost = INT_MAX, ncost; int cost = INT_MAX, ncost = 0;
void *p = NULL, *np; void *p = NULL, *np;
/* Deletions */ /* Deletions */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment