mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
Created a workaround for a bug in MSAN for va_arg(,double)
MDEV-22691 MSAN use-of-uninitialized-value in test maria.maria-recovery2 This caused all my_vsnprintf() using doubles to fail. Thanks to the workaround, I was able to remove the disabling of MSAN in dtoa().
This commit is contained in:
parent
d7a9cdc627
commit
e843033d02
2 changed files with 6 additions and 3 deletions
|
|
@ -2168,9 +2168,6 @@ static int quorem(Bigint *b, Bigint *S)
|
|||
|
||||
static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
|
||||
char **rve, char *buf, size_t buf_size)
|
||||
#if __has_feature(memory_sanitizer)
|
||||
__attribute__((no_sanitize("memory"))) // FIXME: dd is claimed uninitialized
|
||||
#endif
|
||||
{
|
||||
/*
|
||||
Arguments ndigits, decpt, sign are similar to those
|
||||
|
|
|
|||
|
|
@ -704,7 +704,13 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
|
|||
}
|
||||
else if (*fmt == 'f' || *fmt == 'g')
|
||||
{
|
||||
#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
|
||||
__msan_check_mem_is_initialized(ap, sizeof(double));
|
||||
#endif
|
||||
double d= va_arg(ap, double);
|
||||
#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
|
||||
__msan_unpoison(&d, sizeof(double));
|
||||
#endif
|
||||
to= process_dbl_arg(to, end, width, d, *fmt);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue