This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Hoist assertion in target_stack::unpush


*** TEST RESULTS FOR COMMIT 1688cb2916e7bc46c92dd6f5ac2ba0da6c832274 ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: 1688cb2916e7bc46c92dd6f5ac2ba0da6c832274

Hoist assertion in target_stack::unpush

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]