mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-24 03:09:36 +08:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
+9
-15
@@ -71,27 +71,21 @@ public class BookmarkDBAdapterV3 extends BookmarkDBAdapter {
|
||||
throw new VersionException(true);
|
||||
}
|
||||
else if (typeIDs.length != 0) {
|
||||
int version = -1;
|
||||
for (int i = 0; i < typeIDs.length; i++) {
|
||||
int id = typeIDs[i];
|
||||
tables[id] = handle.getTable(BOOKMARK_TABLE_NAME + id);
|
||||
}
|
||||
boolean noTables = (tables[typeIDs[0]] == null);
|
||||
int version = noTables ? -1 : tables[typeIDs[0]].getSchema().getVersion();
|
||||
for (int i = 1; i < typeIDs.length; i++) {
|
||||
int id = typeIDs[i];
|
||||
if (noTables) {
|
||||
if (tables[id] != null) {
|
||||
throw new IOException("Missing bookmark table");
|
||||
}
|
||||
String tableName = BOOKMARK_TABLE_NAME + id;
|
||||
Table table = handle.getTable(tableName);
|
||||
if (table == null) {
|
||||
throw new IOException("Missing bookmark table: " + tableName);
|
||||
}
|
||||
else if (tables[id].getSchema().getVersion() != version) {
|
||||
int schemaVersion = table.getSchema().getVersion();
|
||||
if (version >= 0 && schemaVersion != version) {
|
||||
throw new IOException("Inconsistent bookmark table versions");
|
||||
}
|
||||
tables[id] = table;
|
||||
}
|
||||
if (noTables) {
|
||||
throw new VersionException(true);
|
||||
}
|
||||
else if (version != VERSION) {
|
||||
if (version >= 0 && version != VERSION) {
|
||||
throw new VersionException(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user