diff options
author | Kevin Buettner <kevinb@redhat.com> | 2002-07-31 17:01:01 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2002-07-31 17:01:01 +0000 |
commit | c6caf0909829e2639ac1c4b8cd48baa35b40a747 (patch) | |
tree | a668873e35df3997d8cf480a7a95c47cae74aeca /gdb/utils.c | |
parent | 4eb6b71c65bbf121ebdb51966e5ce2ed411d2848 (diff) | |
download | gdb-c6caf0909829e2639ac1c4b8cd48baa35b40a747.zip gdb-c6caf0909829e2639ac1c4b8cd48baa35b40a747.tar.gz gdb-c6caf0909829e2639ac1c4b8cd48baa35b40a747.tar.bz2 |
* utils.c (host_pointer_to_address, address_to_host_pointer):
Use gdb_assert() instead of explicit call to internal_error().
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 50cab72..01b9dbc 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -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; } |