From df4a245040edd10bad84dcfe935ab17c78c19d18 Mon Sep 17 00:00:00 2001 From: kai Date: Fri, 21 Dec 2012 22:05:28 +0100 Subject: [PATCH] Resolve mismatch between object.di and typinfo.cpp on 64bit non-x86 systems. On Windows x86_64, class TypeInfo_Struct contains 2 additional fields (m_arg1/m_arg2) which are used for the X86_64 System V ABI varargs implementation. They are not present on any other os. This commit changes an assertion which did not check for the os and therefore broke on 64bit non-86 systems like ppc64. --- gen/typinf.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gen/typinf.cpp b/gen/typinf.cpp index 1942c543..566b13d6 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -716,8 +716,11 @@ void TypeInfoStructDeclaration::llvmDefine() ClassDeclaration* tscd = Type::typeinfostruct; - assert((!global.params.is64bit && tscd->fields.dim == 11) || - (global.params.is64bit && tscd->fields.dim == 13)); + // On Windows x86_64, class TypeInfo_Struct contains 2 additional fields + // (m_arg1/m_arg2) which are used for the X86_64 System V ABI varargs + // implementation. They are not present on any other os. + assert((!(global.params.is64bit && global.params.os == OSWindows) && tscd->fields.dim == 11) || + (global.params.is64bit && global.params.os == OSWindows && tscd->fields.dim == 13)); //void function(void*) xdtor; b.push_funcptr(sd->dtor);