From 14107b42b21b53a7c337bab2a5708f31c1a96e1e Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 15 Jul 2009 08:22:00 +0000 Subject: [PATCH] * fixed tw9039{a,b} for 64 bit platforms (qwordvar > int64var) is evaluated by the compiler as (int64(qwordvar) > int64var), which broke the array size check for 64 platforms git-svn-id: trunk@13388 - --- compiler/symdef.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 47290d6505..c51fccc3ab 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -2366,7 +2366,7 @@ implementation { prevent overflow, return -1 to indicate overflow } { also make sure we don't need 64/128 bit arithmetic to calculate offsets } - if (cachedelecount > high(aint)) or + if (cachedelecount > aword(high(aint))) or ((high(aint) div cachedelesize) < aint(cachedelecount)) or { also lowrange*elesize must be < high(aint) to prevent overflow when accessing the array, see ncgmem (PFV) }