Skip to content

Commit

Permalink
Use RVA instead
Browse files Browse the repository at this point in the history
  • Loading branch information
CreateAndInject committed Dec 31, 2023
1 parent f9dec44 commit 9a7c6b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DotNet/Writer/NativeModuleWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -845,11 +845,11 @@ bool GetEntryPoint(out uint ep) {

bool Overlaps() {
for (int i = 0; i < reusedChunks.Count; i++) {
uint start = (uint)reusedChunks[i].Chunk.FileOffset;
uint start = (uint)reusedChunks[i].Chunk.RVA;
uint end = start + reusedChunks[i].Chunk.GetFileLength();
for (int j = 0; j < reusedChunks.Count; j++) {
var chunk = reusedChunks[j].Chunk;
if (i != j && start < (uint)chunk.FileOffset + chunk.GetFileLength() && end > (uint)chunk.FileOffset)
if (i != j && start < (uint)chunk.RVA + chunk.GetFileLength() && end > (uint)chunk.RVA)
return true;
}
}
Expand Down

0 comments on commit 9a7c6b2

Please sign in to comment.