mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Fixed segfault when using va_arg.
Fixed segfault when accessing function symbols from inline asm.
This commit is contained in:
@@ -2036,7 +2036,9 @@ struct AsmProcessor
|
||||
}
|
||||
} else if (exp->op == TOKvar) {
|
||||
VarDeclaration * v = ((VarExp *) exp)->var->isVarDeclaration();
|
||||
v->needsStorage = true;
|
||||
if (v) {
|
||||
v->needsStorage = true;
|
||||
}
|
||||
|
||||
if (v && v->storage_class & STCfield) {
|
||||
operand->constDisplacement += v->offset;
|
||||
|
||||
@@ -254,10 +254,12 @@ DValue* VarExp::toElem(IRState* p)
|
||||
else if (FuncDeclaration* fdecl = var->isFuncDeclaration())
|
||||
{
|
||||
Logger::println("FuncDeclaration");
|
||||
if (fdecl->llvmInternal != LLVMva_arg) {// && fdecl->llvmValue == 0)
|
||||
LLValue* func = 0;
|
||||
if (fdecl->llvmInternal != LLVMva_arg) {
|
||||
DtoForceDeclareDsymbol(fdecl);
|
||||
func = fdecl->ir.irFunc->func;
|
||||
}
|
||||
return new DFuncValue(fdecl, fdecl->ir.irFunc->func);
|
||||
return new DFuncValue(fdecl, func);
|
||||
}
|
||||
else if (SymbolDeclaration* sdecl = var->isSymbolDeclaration())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user