]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/valarith.c
Use value_true in value_equal and value_less
[thirdparty/binutils-gdb.git] / gdb / valarith.c
index b3321e4ff75dd3f0115df9b7a38e13e19aa44f58..25d72b7f38c579a56f2561e2c53c85884e0e73de 100644 (file)
@@ -1745,8 +1745,7 @@ value_equal (struct value *arg1, struct value *arg2)
   is_int2 = is_integral_type (type2);
 
   if (is_int1 && is_int2)
-    return longest_to_int (value_as_long (value_binop (arg1, arg2,
-                                                      BINOP_EQUAL)));
+    return value_true (value_binop (arg1, arg2, BINOP_EQUAL));
   else if ((is_floating_value (arg1) || is_int1)
           && (is_floating_value (arg2) || is_int2))
     {
@@ -1833,8 +1832,7 @@ value_less (struct value *arg1, struct value *arg2)
 
   if ((is_int1 && is_int2)
       || (is_fixed_point_type (type1) && is_fixed_point_type (type2)))
-    return longest_to_int (value_as_long (value_binop (arg1, arg2,
-                                                      BINOP_LESS)));
+    return value_true (value_binop (arg1, arg2, BINOP_LESS));
   else if ((is_floating_value (arg1) || is_int1)
           && (is_floating_value (arg2) || is_int2))
     {