Fix bugs in 'val and 'pos with range types
[deliverable/binutils-gdb.git] / gdb / ada-lang.c
index 7522917401cf60af5a517baf06d74ff09458ab64..5ffb2d6ac9594244561999c0820269579ec93b44 100644 (file)
@@ -9148,6 +9148,9 @@ value_val_atr (struct type *type, struct value *arg)
   if (!integer_type_p (value_type (arg)))
     error (_("'VAL requires integral argument"));
 
+  if (type->code () == TYPE_CODE_RANGE)
+    type = TYPE_TARGET_TYPE (type);
+
   if (type->code () == TYPE_CODE_ENUM)
     {
       long pos = value_as_long (arg);
This page took 0.02579 seconds and 4 git commands to generate.