diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2021-03-09 22:22:19 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-06-17 10:32:13 -0400 |
commit | 3447d9e49e33199b4c5c0fe16e272e3ecfd36275 (patch) | |
tree | 35add57edf3e0a7a3166373e8e7dbee81c9ea2b1 /gcc | |
parent | a6d844cd860880a9d1f028876085a8d1230819b1 (diff) | |
download | gcc-3447d9e49e33199b4c5c0fe16e272e3ecfd36275.zip gcc-3447d9e49e33199b4c5c0fe16e272e3ecfd36275.tar.gz gcc-3447d9e49e33199b4c5c0fe16e272e3ecfd36275.tar.bz2 |
[Ada] Fix detection of slices that denote the same object
gcc/ada/
* sem_util.adb (Denotes_Same_Object): Call Get_Index_Bounds with
the range of a slice object, not its type.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_util.adb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 6481d86..c9d97a9 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -7482,8 +7482,8 @@ package body Sem_Util is Lo1, Lo2, Hi1, Hi2 : Node_Id; begin - Get_Index_Bounds (Etype (Obj1), Lo1, Hi1); - Get_Index_Bounds (Etype (Obj2), Lo2, Hi2); + Get_Index_Bounds (Discrete_Range (Obj1), Lo1, Hi1); + Get_Index_Bounds (Discrete_Range (Obj2), Lo2, Hi2); -- Check whether bounds are statically identical. There is no -- attempt to detect partial overlap of slices. |