Skip to content

Commit

Permalink
Consider Pointers with Attached Type Information as Safe to Dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
jkreindl committed Mar 29, 2019
1 parent e53493e commit 532fc14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public boolean isAlwaysSafeToDereference(long bitOffset) {
return LLVMManagedPointer.isInstance(target);
}

return false;
return bitOffset == 0L && pointer.getExportType() != null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ public boolean isAlwaysSafeToDereference(long bitOffset) {
if (LLVMManagedPointer.isInstance(pointerRead)) {
return LLDBSupport.pointsToObjectAccess(LLVMManagedPointer.cast(pointerRead));
}
return false;

return LLVMPointer.isInstance(pointerRead) && LLVMPointer.cast(pointerRead).getExportType() != null;

}

@Override
Expand Down

0 comments on commit 532fc14

Please sign in to comment.