projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3810ab8
)
Clarifying comment on overflow (#17865)
author
Dan Moseley
<danmose@microsoft.com>
Thu, 3 May 2018 00:20:50 +0000
(17:20 -0700)
committer
GitHub
<noreply@github.com>
Thu, 3 May 2018 00:20:50 +0000
(17:20 -0700)
* Clarifying comment on overflow
* Nits
src/mscorlib/shared/System/Buffers/Utilities.cs
patch
|
blob
|
history
diff --git
a/src/mscorlib/shared/System/Buffers/Utilities.cs
b/src/mscorlib/shared/System/Buffers/Utilities.cs
index 9e8a888bee080e339152b573693d28fd03fe8c1a..b675100b03bb60917fda9ed8bea4c0ce02a643c3 100644
(file)
--- a/
src/mscorlib/shared/System/Buffers/Utilities.cs
+++ b/
src/mscorlib/shared/System/Buffers/Utilities.cs
@@
-14,6
+14,9
@@
namespace System.Buffers
{
Debug.Assert(bufferSize >= 0);
+ // bufferSize of 0 will underflow here, causing a huge
+ // index which the caller will discard because it is not
+ // within the bounds of the bucket array.
uint bitsRemaining = ((uint)bufferSize - 1) >> 4;
int poolIndex = 0;