[MSan] Fix calling pointers to varargs functions on SystemZ
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 6 Feb 2023 22:28:06 +0000 (23:28 +0100)
committerIlya Leoshkevich <iii@linux.ibm.com>
Mon, 6 Feb 2023 22:35:13 +0000 (23:35 +0100)
commit322e150e3392026a205c583da80e8971653825c8
treeb0152f73dadea06cc5acb459be9558dd800ab9ae
parent254e2ad84407fce81f3b0c07e75f23671b8cb56a
[MSan] Fix calling pointers to varargs functions on SystemZ

VarArgSystemZHelper.visitCallBase() checks whether the callee has the
"use-soft-float" attribute, but if the callee is a function pointer, a
null pointer dereference happens.

Fix by checking this attribute on the current function. Alternatively,
one could try the callee first, but this is pointless, since one should
not be mixing hardfloat and softfloat code anyway.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D143296
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/test/Instrumentation/MemorySanitizer/SystemZ/vararg-kernel.ll
llvm/test/Instrumentation/MemorySanitizer/SystemZ/vararg.ll