Mercurial > projects > ldc
comparison gen/toir.cpp @ 384:3f98d46e05a4
Fixed segfault when using va_arg.
Fixed segfault when accessing function symbols from inline asm.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 23 Jul 2008 20:21:18 +0200 |
parents | d632801b15f0 |
children | 9ec89aad9dbc |
comparison
equal
deleted
inserted
replaced
383:c028fd91b3b0 | 384:3f98d46e05a4 |
---|---|
252 } | 252 } |
253 } | 253 } |
254 else if (FuncDeclaration* fdecl = var->isFuncDeclaration()) | 254 else if (FuncDeclaration* fdecl = var->isFuncDeclaration()) |
255 { | 255 { |
256 Logger::println("FuncDeclaration"); | 256 Logger::println("FuncDeclaration"); |
257 if (fdecl->llvmInternal != LLVMva_arg) {// && fdecl->llvmValue == 0) | 257 LLValue* func = 0; |
258 if (fdecl->llvmInternal != LLVMva_arg) { | |
258 DtoForceDeclareDsymbol(fdecl); | 259 DtoForceDeclareDsymbol(fdecl); |
259 } | 260 func = fdecl->ir.irFunc->func; |
260 return new DFuncValue(fdecl, fdecl->ir.irFunc->func); | 261 } |
262 return new DFuncValue(fdecl, func); | |
261 } | 263 } |
262 else if (SymbolDeclaration* sdecl = var->isSymbolDeclaration()) | 264 else if (SymbolDeclaration* sdecl = var->isSymbolDeclaration()) |
263 { | 265 { |
264 // this seems to be the static initialiser for structs | 266 // this seems to be the static initialiser for structs |
265 Type* sdecltype = DtoDType(sdecl->type); | 267 Type* sdecltype = DtoDType(sdecl->type); |