From 22c31ca004e0c04b68d013cf3db2f55749f874bb Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 12 Jun 2016 09:21:00 +0000 Subject: [PATCH] * fixed LLVM vecn typed constant evaluation if the lower bound is <> 0 git-svn-id: trunk@33959 - --- compiler/llvm/nllvmtcon.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/llvm/nllvmtcon.pas b/compiler/llvm/nllvmtcon.pas index 1558c0d61a..b46d799fd2 100644 --- a/compiler/llvm/nllvmtcon.pas +++ b/compiler/llvm/nllvmtcon.pas @@ -583,10 +583,14 @@ implementation ai: taillvm; aityped: tai; eledef: tdef; + vecindex: asizeint; begin { update range checking info } inherited; - ai:=taillvm.getelementptr_reg_tai_size_const(NR_NO,nil,ptrsinttype,index.svalue,true); + vecindex:=index.svalue; + if def.typ=arraydef then + dec(vecindex,tarraydef(def).lowrange); + ai:=taillvm.getelementptr_reg_tai_size_const(NR_NO,nil,ptrsinttype,vecindex,true); case def.typ of arraydef: eledef:=tarraydef(def).elementdef;