mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-01 01:53:16 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user