Skip to content

Fix typos and improve formatting #12

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

Merged
merged 1 commit into from
Mar 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/undefined_behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ There are a couple misconceptions about UB that often muddy the water when talki
Undefined Behavior may be present even if the compiler does end up compiling the
code according to the programmer's intent. A future version of the compiler may
behave differently, or future changes to an innocuous portion of the code may
cause it to fall to the other side of an invisible threshhold. Technically it
cause it to fall to the other side of an invisible threshold. Technically it
may even compile differently but only on Tuesdays, though that type of
nondeterminism is generally rare.

Expand All @@ -193,10 +193,10 @@ Firstly, some forms of UB just have to do with rules the underlying processor
enforces.

But more than that, there are plenty of miscompiles that are hard to explain by
simply thinking in terms why the optimizer would do such a thing.
simply thinking in terms of why the optimizer would do such a thing.

This is because it's less about what the optimizer is "allowed to do" and more
about what it is "allowed to assume". When a code has UB, the optimizer may
This is because it's less about what the optimizer is allowed to _do_ and more
about what it is allowed to _assume_. When a program has UB, the optimizer may
make an incorrect assumption that snowballs into bigger and bigger incorrect
assumptions that cause very unexpected behavior.

Expand Down