summaryrefslogtreecommitdiff
path: root/gcc/ada/g-debpoo.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:59:28 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-10-31 17:59:28 +0000
commit4ae1e6f7f33111aafa2b9c7f7c7f4e6ade5869e1 (patch)
tree4af9657b3086c12b125479e16eb8bc0a160e50cd /gcc/ada/g-debpoo.adb
parentfdf6bbd0a5e8cac253200b57ca3173f6591c9178 (diff)
downloadgcc-4ae1e6f7f33111aafa2b9c7f7c7f4e6ade5869e1.tar.gz
2006-10-31 Vincent Celier <celier@adacore.com>
* g-debpoo.adb (Is_Valid): Correctly compute Offset using Integer_Address arithmetic, as in Set_Valid. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118275 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-debpoo.adb')
-rw-r--r--gcc/ada/g-debpoo.adb13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/g-debpoo.adb b/gcc/ada/g-debpoo.adb
index 1854623da34..770f731aa1e 100644
--- a/gcc/ada/g-debpoo.adb
+++ b/gcc/ada/g-debpoo.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -555,9 +555,18 @@ package body GNAT.Debug_Pools is
--------------
function Is_Valid (Storage : System.Address) return Boolean is
+
+ -- We use the following constant declaration, instead of
+ -- Offset : constant Storage_Offset :=
+ -- (Storage - Edata) / Default_Alignment;
+ -- See comments in Set_Valid for details.
+
Offset : constant Storage_Offset :=
- (Storage - Edata) / Default_Alignment;
+ Storage_Offset ((To_Integer (Storage) - To_Integer (Edata)) /
+ Default_Alignment);
+
Bit : constant Byte := 2 ** Natural (Offset mod System.Storage_Unit);
+
begin
return (Storage mod Default_Alignment) = 0
and then Offset >= 0