From 73dc899ff1483270ff12d1503744885b143ba308 Mon Sep 17 00:00:00 2001 From: Andrey Guskov Date: Sat, 6 Jun 2015 01:16:56 +0300 Subject: [PATCH] Fixed MAXINT array size limitation --- expr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/expr.cpp b/expr.cpp index e829f578..fbb7e52d 100644 --- a/expr.cpp +++ b/expr.cpp @@ -4620,10 +4620,11 @@ IndexExpr::TypeCheck() { // 64-bit target with 64-bit addressing, convert the index to an int32 // type. // The range of varying index is limited to [0,2^31) as a result. - if (Type::EqualIgnoringConst(indexType->GetAsUniformType(), - AtomicType::UniformInt64) == false || - g->target->is32Bit() || - g->opt.force32BitAddressing) { + if (!(Type::EqualIgnoringConst(indexType->GetAsUniformType(), + AtomicType::UniformUInt64) || + Type::EqualIgnoringConst(indexType->GetAsUniformType(), + AtomicType::UniformInt64)) || + g->target->is32Bit() || g->opt.force32BitAddressing) { const Type *indexType = AtomicType::VaryingInt32; index = TypeConvertExpr(index, indexType, "array index"); if (index == NULL)