Enforce type consistency for most DValues

At the cost of some more bitcasts.
This commit is contained in:
Martin 2016-07-17 06:20:33 +02:00
parent 88b19d3d51
commit d6dcc7a4db
7 changed files with 78 additions and 99 deletions

View file

@ -596,7 +596,7 @@ bool DtoLowerMagicIntrinsic(IRState *p, FuncDeclaration *fndecl, CallExp *e,
Expression *exp1 = (*e->arguments)[0];
LLValue *ptr = DtoRVal(exp1);
result = new DImValue(exp1->type, DtoVolatileLoad(ptr));
result = new DImValue(e->type, DtoVolatileLoad(ptr));
return true;
}
@ -849,7 +849,7 @@ DValue *DtoCallFunction(Loc &loc, Type *resulttype, DValue *fnval,
arguments ? arguments->dim : 0; // number of explicit arguments
std::vector<DValue *> argvals(n_arguments, static_cast<DValue *>(nullptr));
if (dfnval && dfnval->func->isArrayOp) {
if (dfnval && dfnval->func && dfnval->func->isArrayOp) {
// For array ops, the druntime implementation signatures are crafted
// specifically such that the evaluation order is as expected with
// the strange DMD reverse parameter passing order. Thus, we need