Skip to content

Commit 8bb5ac6

Browse files
committed
Note that UB is program-global
1 parent 5bcb36b commit 8bb5ac6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/behavior-considered-undefined.md

Lines changed: 6 additions & 0 deletions
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.
45+
> And vice versa, undefined behavior in `Rust` can cause adverse affects on
46+
> code 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)