chiark / gitweb /
Fix a valgrind warning in the Keen DIFF_HARD solver code.
authorSimon Tatham <anakin@pobox.com>
Sun, 3 Jan 2016 09:51:15 +0000 (09:51 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 3 Jan 2016 09:51:15 +0000 (09:51 +0000)
commit55683abd97f94286982924ff0fecd03044e82bed
tree9169c07477a6471b91382faf795e720adc8b4c63
parentff91d2d78d96441893acd1b1099726346e7f84cf
Fix a valgrind warning in the Keen DIFF_HARD solver code.

The solver's array ctx->iscratch[] is used for a completely different
purpose in the DIFF_HARD code, compared to what it's used for in
DIFF_EASY and DIFF_NORMAL. In particular, a different number of
elements of the array are used - but the code which sets up the array
was not correctly initialising all of them.

I was also unable to find any clear comment that even explained _that_
the purpose of the array was entirely different between the two cases,
let alone explaining _what_ the two purposes were. So I've written
some comments as part of this commit, which should make things a bit
less confusing next time. (Though not much, I admit.)
keen.c