Skip to content

Commit

Permalink
Merge pull request #490 from Havvy/ub-in-other-langs
Browse files Browse the repository at this point in the history
Note that UB is program-global
  • Loading branch information
Centril committed Mar 11, 2019
2 parents 0cd2755 + cdb2177 commit 3af9d03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/behavior-considered-undefined.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ code.
* A value in a `char` which is a surrogate or above `char::MAX`.
* Non-UTF-8 byte sequences in a `str`.

> **Note**: Undefined behavior affects the entire program. For example, calling
> a function in C that exhibits undefined behavior of C means your entire
> program contains undefined behaviour that can also affect the Rust code. And
> vice versa, undefined behavior in Rust can cause adverse affects on code
> executed by any FFI calls to other languages.
[noalias]: http://llvm.org/docs/LangRef.html#noalias
[pointer aliasing rules]: http://llvm.org/docs/LangRef.html#pointer-aliasing-rules
[undef]: http://llvm.org/docs/LangRef.html#undefined-values
Expand Down

0 comments on commit 3af9d03

Please sign in to comment.