Skip to content

Commit

Permalink
Fix REPL not recognising label displacement
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed May 27, 2024
1 parent c166e36 commit 41a8f1c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Debugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,11 @@ private bool ProcessReplInput(string userInput)
{
throw new LabelNameException(string.Format(Strings_Debugger.REPL_Error_Label_Not_Exists, labelName));
}
#if DISPLACEMENT
// Any displacement has already been written to the program,
// read it back and add it to the resolved label address
address += BinaryPrimitives.ReadUInt64LittleEndian(new ReadOnlySpan<byte>(newBytes)[(int)addressOffset..]);
#endif
BinaryPrimitives.WriteUInt64LittleEndian(newBytes.AsSpan()[(int)addressOffset..], address);
}

Expand Down

0 comments on commit 41a8f1c

Please sign in to comment.