Skip to content

Commit

Permalink
Write null-terminator for the augmentationString.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulusParssinen committed May 11, 2024
1 parent bafd05f commit 77a600d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void WriteCie(DwarfCie cie)
4u + // Length
4u + // CIE Offset (0)
1u + // Version
(uint)augmentationString.Length + 1u +
(uint)augmentationString.Length + 1u + // null-terminator
DwarfHelper.SizeOfULEB128(cie.CodeAlignFactor) +
DwarfHelper.SizeOfSLEB128(cie.DataAlignFactor) +
DwarfHelper.SizeOfULEB128(cie.ReturnAddressRegister) +
Expand All @@ -94,6 +94,7 @@ private void WriteCie(DwarfCie cie)

_sectionWriter.WriteByte(cie.ReturnAddressRegister < 0x7F ? (byte)1u : (byte)3u); // Version
_sectionWriter.Write(augmentationString.AsSpan());
_sectionWriter.WriteByte(0); // null-terminator

_sectionWriter.WriteULEB128(cie.CodeAlignFactor);
_sectionWriter.WriteSLEB128(cie.DataAlignFactor);
Expand Down

0 comments on commit 77a600d

Please sign in to comment.