Fix use-after-move in compile/compile-cplus-types.c
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 17 Sep 2018 17:11:07 +0000 (13:11 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 17 Sep 2018 17:11:07 +0000 (13:11 -0400)
commit461464f22632163209937ba5128d1f9f32554ea3
treeaedb5efa545c00cbab381b348794437ce92b0c67
parent04e2a1829ea137ac23ac96e98fd60f9d720dcdcb
Fix use-after-move in compile/compile-cplus-types.c

Patch

  d82b3862f12 ("compile: Remove non-const reference parameters")

introduced a regression in compile/compile-cplus-types.c.  The new_scope
variable in compile_cplus_instance::enter_scope is used after it was
std::moved.  This patch fixes it by referring to the back of the vector
where it was moved instead.

gdb/ChangeLog:

* compile/compile-cplus-types.c
(compile_cplus_instance::enter_scope): Don't use new_scope after
std::move.
gdb/ChangeLog
gdb/compile/compile-cplus-types.c