Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: outbuffer: annotate pure and clarify branching on LEB128 func… #13239

Merged
merged 1 commit into from Oct 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/dmd/common/outbuffer.d
Expand Up @@ -727,15 +727,15 @@ struct OutBuffer
return extractData();
}

void writesLEB128(int value) nothrow
void writesLEB128(int value) pure nothrow
{
while (1)
{
ubyte b = value & 0x7F;

value >>= 7; // arithmetic right shift
if (value == 0 && !(b & 0x40) ||
value == -1 && (b & 0x40))
if ((value == 0 && !(b & 0x40)) ||
(value == -1 && (b & 0x40)))
{
writeByte(b);
break;
Expand All @@ -744,7 +744,7 @@ struct OutBuffer
}
}

void writeuLEB128(uint value) nothrow
void writeuLEB128(uint value) pure nothrow
{
do
{
Expand Down