Skip to content

Commit 9059385

Browse files
grooverdandr-m
authored andcommitted
MDEV-37048 revert MSAN my_vsnprintf_ex for double workaround
5 years ago e843033 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 e843033 have been reverted. Tested with clang-20.1 and the test cases from MDEV-22690 and MDEV-22691.
1 parent 0dd6566 commit 9059385

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

strings/my_vsnprintf.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -739,13 +739,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
739739
else if (*fmt == 'f' || *fmt == 'g')
740740
{
741741
double d;
742-
#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
743-
__msan_check_mem_is_initialized(ap, sizeof(double));
744-
#endif
745742
d= va_arg(ap, double);
746-
#if __has_feature(memory_sanitizer) /* QQ: MSAN has double trouble? */
747-
__msan_unpoison(&d, sizeof(double));
748-
#endif
749743
to= process_dbl_arg(to, end, width, d, *fmt);
750744
continue;
751745
}

0 commit comments

Comments
 (0)