Skip to content

Commit

Permalink
GP-3417 fixed case where si vtable was not getting created bc too man…
Browse files Browse the repository at this point in the history
…y refs. Added secondary check. Added check for same num special vtable and typeinfos.
  • Loading branch information
ghidra007 committed May 8, 2023
1 parent b3616a6 commit 8580bad
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ public List<RecoveredClass> createRecoveredClasses() throws CancelledException,
Msg.debug(this, "Could not create special vtables");
return null;
}

if(specialVtables.size() != specialTypeinfos.size()) {
Msg.debug(this, "Not equal number of special vtables and special typeinfos");
return null;
}

setComponentOffset();

Expand Down Expand Up @@ -3382,6 +3387,13 @@ private Address findSpecialVtableUsingSpecialTypeinfo(Address typeinfoAddress, L
if (specialTypeinfoAddrSet.contains(refTo)) {
continue;
}

// all special vtables have zeros just before the ref to typeinfo
Address vtableAddress = refTo.subtract(defaultPointerSize);
if (!isPossibleNullPointer(vtableAddress)) {
continue;
}

possibleRefsInVtable.add(refTo);
}
if (possibleRefsInVtable.size() != 1) {
Expand Down

0 comments on commit 8580bad

Please sign in to comment.