MDEV-37048 revert MSAN my_vsnprintf_ex for double workaround

5 years ago e843033d02 worked around a
MSAN bug when retrieving a double from a va_list.

The construct {{__msan_check_mem_is_initialized(ap,size)}} where ap
is a va_list is undefined as {{__msan_check_mem_is_initialized}}
expects a pointer. The implementation detail of va_list is architecture
dependant and on aarch64 this isn't a pointer.

The need to any msan action is no unnecessary since this has been
corrected in recent clang versions.

As such the additions from e843033d02
have been reverted.

Tested with clang-20.1 and the test cases from MDEV-22690 and
MDEV-22691.
This commit is contained in:
Daniel Black 2025-06-20 10:41:50 +10:00 committed by Marko Mäkelä
commit 9059385262

View file

@ -739,13 +739,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
else if (*fmt == 'f' || *fmt == 'g')
{
double d;
#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
__msan_check_mem_is_initialized(ap, sizeof(double));
#endif
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;
}