Fix bugs in 'val and 'pos with range types
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 4fe8d9a8e9cc3b439113427b0694676dd0f76023..2ee69899a935911819e4b49de35e8d21e9f16741 100644 (file)
@@ -1155,6 +1155,9 @@ get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound)
 int
 discrete_position (struct type *type, LONGEST val, LONGEST *pos)
 {
+  if (type->code () == TYPE_CODE_RANGE)
+    type = TYPE_TARGET_TYPE (type);
+
   if (type->code () == TYPE_CODE_ENUM)
     {
       int i;
This page took 0.026397 seconds and 4 git commands to generate.