Fix va_arg handling.

The change of symbol emission ignored the fact that the va_arg intrinsic must be
handled in a special way. This commit corrects the omission (which leads to seg
faults on Linux/PPC64).
This commit is contained in:
kai
2013-10-25 16:15:52 +02:00
parent e5fe110280
commit 835e972e6b

View File

@@ -1916,7 +1916,8 @@ DValue* DtoSymbolAddress(const Loc& loc, Type* type, Declaration* decl)
fatal();
}
DtoResolveFunction(fdecl);
return new DFuncValue(fdecl, fdecl->ir.irFunc->func);
assert(fdecl->llvmInternal == LLVMva_arg || fdecl->ir.irFunc);
return new DFuncValue(fdecl, fdecl->ir.irFunc ? fdecl->ir.irFunc->func : 0);
}
if (SymbolDeclaration* sdecl = decl->isSymbolDeclaration())
@@ -2028,4 +2029,4 @@ FuncDeclaration* getParentFunc(Dsymbol* sym, bool stopOnStatic) {
}
return (parent ? parent->isFuncDeclaration() : NULL);
}
}