Fix internal error in value_cast_pointers

Andreas Schwab
2008-07-15T21:40:23Z

This patch fixes five regressions in bs15503.exp. value_ind has never
returned a value whose type has typedefs stripped off (the type is
always the direct target of the pointer type). Tested on ppc-linux.
OK?

Andreas.

2008-07-15 Andreas Schwab <schwab@suse.de>

* valops.c (value_cast_pointers): Follow typedefs when checking
result of coercion.

--- valops.c.~1.191.~ 2008-06-08 17:05:35.000000000 +0200
+++ valops.c 2008-07-15 22:59:34.000000000 +0200
@@ -268,7 +268,7 @@ value_cast_pointers (struct type *type,
v2 = coerce_ref (arg2);
else
v2 = value_ind (arg2);
- gdb_assert (TYPE_CODE (value_type (v2)) == TYPE_CODE_STRUCT
+ gdb_assert (TYPE_CODE (check_typedef (value_type (v2))) == TYPE_CODE_STRUCT
&& !!"Why did coercion fail?");
v2 = value_cast_structs (t1, v2);
/* At this point we have what we can have, un-dereference if needed. */

--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃŸe 5, 90409 NÃ¼rnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."