Skip to content

Commit 3af9d03

Browse files
authored
Merge pull request #490 from Havvy/ub-in-other-langs
Note that UB is program-global
2 parents 0cd2755 + cdb2177 commit 3af9d03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/behavior-considered-undefined.md

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ code.
3939
* A value in a `char` which is a surrogate or above `char::MAX`.
4040
* Non-UTF-8 byte sequences in a `str`.
4141

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

0 commit comments

Comments
 (0)