From c0b41ad6f579c784ecc5b2620ec52c53b996347d Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 14 Dec 2011 16:18:10 -0800 Subject: [PATCH] Fix bug in mask selection for references. We should always use the full mask when storing to a reference, since we don't in general know what it refers to (and thence the appropriate mask to use for its target). --- expr.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/expr.cpp b/expr.cpp index 577f61a7..4d76d583 100644 --- a/expr.cpp +++ b/expr.cpp @@ -638,10 +638,12 @@ lLLVMConstantValue(const Type *type, llvm::LLVMContext *ctx, double value) { static llvm::Value * lMaskForSymbol(Symbol *baseSym, FunctionEmitContext *ctx) { - if (dynamic_cast(baseSym->type) != NULL) - // FIXME: we really only want to do this for dereferencing the - // pointer, not for things like pointer arithmetic, when we may be - // able to use the internal mask, depending on context... + if (dynamic_cast(baseSym->type) != NULL || + dynamic_cast(baseSym->type) != NULL) + // FIXME: for pointers, we really only want to do this for + // dereferencing the pointer, not for things like pointer + // arithmetic, when we may be able to use the internal mask, + // depending on context... return ctx->GetFullMask(); llvm::Value *mask = (baseSym->parentFunction == ctx->GetFunction() &&