forked from Imagelibrary/binutils-gdb
Make bcache more type-safe
The bcache uses memcpy to make copies of the data passed to it. In C++, this is only safe for trivially-copyable types. This patch changes bcache to require this property, and slightly changes the API to make it easier to use when copying a single object. It also makes the new 'insert' template methods return the correct type.
This commit is contained in:
@@ -4372,7 +4372,7 @@ check_types_worklist (std::vector<type_equality_entry> *worklist,
|
||||
|
||||
/* If the type pair has already been visited, we know it is
|
||||
ok. */
|
||||
cache->insert (&entry, sizeof (entry), &added);
|
||||
cache->insert (entry, &added);
|
||||
if (!added)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user