* utils.c (host_pointer_to_address, address_to_host_pointer):
authorKevin Buettner <kevinb@redhat.com>
Wed, 31 Jul 2002 17:01:01 +0000 (17:01 +0000)
committerKevin Buettner <kevinb@redhat.com>
Wed, 31 Jul 2002 17:01:01 +0000 (17:01 +0000)
Use gdb_assert() instead of explicit call to internal_error().

gdb/ChangeLog
gdb/utils.c

index b61a1dade392e42b4001c2952c2b69d43b80c7c8..ef18e71b1a95db455abc332933a6210ac2b71210 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-31  Kevin Buettner  <kevinb@redhat.com>
+
+       * utils.c (host_pointer_to_address, address_to_host_pointer):
+       Use gdb_assert() instead of explicit call to internal_error().
+
 2002-07-30  Kevin Buettner  <kevinb@redhat.com>
 
        * Makefile.in (rs6000-nat.o): Update dependencies.
index 50cab720602ff4476211725b8293cae955cce5fb..01b9dbc52a1b9bca6c6240ef77aadac41e6315c9 100644 (file)
@@ -2462,9 +2462,7 @@ phex_nz (ULONGEST l, int sizeof_l)
 CORE_ADDR
 host_pointer_to_address (void *ptr)
 {
-  if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
-    internal_error (__FILE__, __LINE__,
-                   "host_pointer_to_address: bad cast");
+  gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
   return POINTER_TO_ADDRESS (builtin_type_void_data_ptr, &ptr);
 }
 
@@ -2472,9 +2470,8 @@ void *
 address_to_host_pointer (CORE_ADDR addr)
 {
   void *ptr;
-  if (sizeof (ptr) != TYPE_LENGTH (builtin_type_void_data_ptr))
-    internal_error (__FILE__, __LINE__,
-                   "address_to_host_pointer: bad cast");
+
+  gdb_assert (sizeof (ptr) == TYPE_LENGTH (builtin_type_void_data_ptr));
   ADDRESS_TO_POINTER (builtin_type_void_data_ptr, &ptr, addr);
   return ptr;
 }