I noticed that target_stack::unpush first uses the target "t", then
later asserts that it is non-NULL:
strata stratum = t->stratum ();
[...]
gdb_assert (t != NULL);
This is backwards, though, as the assertion must come first.
gdb/ChangeLog
2019-02-05 Tom Tromey <tom@tromey.com>
* target.c (target_stack::unpush): Move assertion earlier.
+2019-02-05 Tom Tromey <tom@tromey.com>
+
+ * target.c (target_stack::unpush): Move assertion earlier.
+
2019-01-30 Tom Tromey <tom@tromey.com>
PR python/23615:
bool
target_stack::unpush (target_ops *t)
{
+ gdb_assert (t != NULL);
+
strata stratum = t->stratum ();
if (stratum == dummy_stratum)
internal_error (__FILE__, __LINE__,
_("Attempt to unpush the dummy target"));
- gdb_assert (t != NULL);
-
/* Look for the specified target. Note that a target can only occur
once in the target stack. */