From f92ff6b55219a7c4c54a62412e194bbda713cf46 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 11 Feb 2020 17:31:10 -0700 Subject: [PATCH] Don't allow copying of auto_obstack Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying it. Copying an auto_obstack would be a bug. 2020-02-11 Tom Tromey * gdb_obstack.h (struct auto_obstack): Use DISABLE_COPY_AND_ASSIGN. Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd --- gdb/ChangeLog | 5 +++++ gdb/gdb_obstack.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 72a6292101b..4a4fa054c89 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-02-11 Tom Tromey + + * gdb_obstack.h (struct auto_obstack): Use + DISABLE_COPY_AND_ASSIGN. + 2020-02-11 Tom Tromey * dwarf2/frame.h (struct objfile): Don't forward declare. diff --git a/gdb/gdb_obstack.h b/gdb/gdb_obstack.h index fb9295f5020..9b1d907678f 100644 --- a/gdb/gdb_obstack.h +++ b/gdb/gdb_obstack.h @@ -125,6 +125,8 @@ struct auto_obstack : obstack ~auto_obstack () { obstack_free (this, NULL); } + DISABLE_COPY_AND_ASSIGN (auto_obstack); + /* Free all memory in the obstack but leave it valid for further allocation. */ void clear () -- 2.30.2