Skip to content

Commit d171d97

Browse files
committed
fix some typos.
1 parent ca617ae commit d171d97

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

rust/arith-overflow-buglist.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
List of Bugs uncovered in Rust via arithmetic overflow checking
22
===============================================================
3+
34
This document is a list of bugs that were uncovered during the
45
implementation and deployment of arithmetic overflow checking.
6+
57
This list is restricted solely to *legitimate* bugs. Cases
68
where the overflow was benign (e.g. the computed value is
79
unused), transient (e.g. the computed wrapped value is
810
guaranteed to be brought back into the original range, such as
9-
in `unsigned - 1 + provably_ tpositive`), or silly (random
11+
in `unsigned - 1 + provably_positive`), or silly (random
1012
non-functional code in the tests or documentation) are not
1113
included in the list.
14+
1215
However, extremely rare or obscure corner cases are considered
1316
legitimate bugs. (We begin with such a case.)
1417

@@ -20,8 +23,8 @@ legitimate bugs. (We begin with such a case.)
2023
does need to handle out-of-bounds inputs, so this
2124
appeared benign at first, but there is the corner case
2225
of an iterator that actually covers the whole range
23-
of indices, which would then return Some(_) here when
24-
(pnkfelix thinks) None should be expected.
26+
of indices, which would then return `Some(_)` here when
27+
(pnkfelix thinks) `None` should be expected.
2528

2629
reference:
2730
https://github.com/rust-lang/rust/pull/22532#issuecomment-75168901
@@ -89,7 +92,7 @@ legitimate bugs. (We begin with such a case.)
8992
my_stack_top + 20000 - OS_DEFAULT_STACK_ESTIMATE;
9093
```
9194
92-
where OS_DEFAULT_STACK_ESTIMATE is a large value
95+
where `OS_DEFAULT_STACK_ESTIMATE` is a large value
9396
(> 1mb).
9497
9598
However, my claim is that this code is playing guessing
@@ -100,6 +103,7 @@ legitimate bugs. (We begin with such a case.)
100103
for now. (pnkfelix subsequently changed the code to use
101104
saturated arithmetic in both cases, though obviously
102105
that could be tweaked a bit.)
106+
103107
4. struct order of evaluation
104108
105109
There is an explanatory story here:
@@ -112,8 +116,8 @@ legitimate bugs. (We begin with such a case.)
112116
out an attempt to reserve a ridiculous amount
113117
of space within a `Vec`. (This was on an experimental
114118
branch of the codebase where we would fill with
115-
a series of 0xC1 bytes when a value was dropped, rather
116-
than filling with 0x00 bytes.)
119+
a series of `0xC1` bytes when a value was dropped, rather
120+
than filling with `0x00` bytes.)
117121
118122
It is actually quite likely that this test would still
119123
have failed without the arithmetic overflow checking,

0 commit comments

Comments
 (0)