|
From: <em...@fr...> - 2019-03-04 19:22:02
|
From: Ed Maste <em...@fr...> Clang/LLVM trips over my_offsetof in VEX/auxprogs/genoffsets.c. See LLVM PR 40890 for details (https://bugs.llvm.org/show_bug.cgi?id=40890). Now, it's a Clang bug that Clang exits on an assertion failure rather than emits a diagnostic, but the previous my_offsetof expression is a pointer, not an integer. Add a cast as done in none/tests/x86/x87trigOOR.c's my_offsetof. --- VEX/auxprogs/genoffsets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VEX/auxprogs/genoffsets.c b/VEX/auxprogs/genoffsets.c index 1f680e4f6..221f7ab29 100644 --- a/VEX/auxprogs/genoffsets.c +++ b/VEX/auxprogs/genoffsets.c @@ -59,7 +59,7 @@ #define VG_STRINGIFZ(__str) #__str #define VG_STRINGIFY(__str) VG_STRINGIFZ(__str) -#define my_offsetof(__type,__field) (&((__type*)0)->__field) +#define my_offsetof(__type,__field) ((int)(unsigned long int)&((__type*)0)->__field) /* This forces gcc to evaluate the my_offsetof call at compile time, and then emits it in the assembly, along with the nonsense string -- 2.20.1 |