Fixed crashes when compiling interpret test.

This commit is contained in:
Alexey Prokhin
2010-12-17 12:55:28 +03:00
parent f5f5c2e1f9
commit eccd26ac93
4 changed files with 15 additions and 6 deletions

View File

@@ -356,10 +356,14 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
// ... or a nested function context arg
else if (nestedcall)
{
LLValue* contextptr = DtoNestedContext(loc, dfnval->func);
contextptr = DtoBitCast(contextptr, getVoidPtrType());
if (dfnval) {
LLValue* contextptr = DtoNestedContext(loc, dfnval->func);
contextptr = DtoBitCast(contextptr, getVoidPtrType());
args.push_back(contextptr);
} else {
args.push_back(llvm::UndefValue::get(getVoidPtrType()));
}
++argiter;
args.push_back(contextptr);
}
else
{