Skip to content

Conversation

Nashenas88
Copy link
Contributor

While debugging a comment at the top of a test string, I discovered that the offset calculations could underflow and panic. This only seemed to occur in tests, I assume because it's running a debug mode. The wrapping is quickly fixed later on in release mode, which is why this seems to have gone unnoticed. The new checks ensure the value is always positive or zero.

@Nashenas88
Copy link
Contributor Author

r? @ltentrup

@ltentrup
Copy link
Contributor

good catch, lgtm

@matklad
Copy link
Contributor

matklad commented Jun 23, 2020

bors d+

@bors
Copy link
Contributor

bors bot commented Jun 23, 2020

✌️ Nashenas88 can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@Nashenas88
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 23, 2020

@bors bors bot merged commit 3e09dbb into rust-lang:master Jun 23, 2020
@Nashenas88 Nashenas88 deleted the fix-early-doctest-crash branch June 23, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants