1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix a valgrind warning in decimal.c:sanity()

sql/my_decimal.h:
  Refixing the valgrind warning in decimal.c:sanity() in a different way
  (as requested by Monty): we want to let valgrind see uninitialized
  memory whenever it's possible.
strings/decimal.c:
  Fix sanity() to not look into possibly uninitialized memory if
  HAVE_purify.
This commit is contained in:
unknown
2005-03-21 12:57:42 +03:00
parent 2ba3544f0e
commit 35e6a4b418
2 changed files with 5 additions and 1 deletions

View File

@ -139,8 +139,12 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
999900000, 999990000, 999999000,
999999900, 999999990 };
#ifdef HAVE_purify
#define sanity(d) DBUG_ASSERT((d)->len > 0)
#else
#define sanity(d) DBUG_ASSERT((d)->len >0 && ((d)->buf[0] | \
(d)->buf[(d)->len-1] | 1))
#endif
#define FIX_INTG_FRAC_ERROR(len, intg1, frac1, error) \
do \