OSDN Git Service

* ada-lang.c (ada_modulus): Correct to avoid sign problem with
authorJoel Brobecker <brobecker@gnat.com>
Tue, 30 Sep 2008 21:53:32 +0000 (21:53 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 30 Sep 2008 21:53:32 +0000 (21:53 +0000)
        moduli >= 2**31.

gdb/ChangeLog
gdb/ada-lang.c

index d67ea1c..f6d30f1 100644 (file)
@@ -1,4 +1,9 @@
-2008-09-30  Paul Hilfinger  <brobecker@adacore.com>
+2008-09-30  Paul Hilfinger  <hilfinger@adacore.com>
+
+       * ada-lang.c (ada_modulus): Correct to avoid sign problem with
+       moduli >= 2**31.
+
+2008-09-30  Paul Hilfinger  <hilfinger@adacore.com>
 
        * ada-lang.c (ada_lookup_struct_elt_type): Handle case of a "naked"
        variant branch.
index 5350516..3c4f05a 100644 (file)
@@ -9626,7 +9626,7 @@ ada_is_modular_type (struct type *type)
 ULONGEST
 ada_modulus (struct type * type)
 {
-  return (ULONGEST) TYPE_HIGH_BOUND (type) + 1;
+  return (ULONGEST) (unsigned int) TYPE_HIGH_BOUND (type) + 1;
 }
 \f