From 8bb5ac64fb751322ebd3680f5259f41da66a606c Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Fri, 28 Dec 2018 15:56:59 -0800 Subject: [PATCH 1/2] Note that UB is program-global --- src/behavior-considered-undefined.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/behavior-considered-undefined.md b/src/behavior-considered-undefined.md index 612aac0c9..720aaff2e 100644 --- a/src/behavior-considered-undefined.md +++ b/src/behavior-considered-undefined.md @@ -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 From cdb2177cfe60a40f044bbef7ea5295021a809f7c Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Sun, 10 Mar 2019 22:31:18 -0700 Subject: [PATCH 2/2] Don't code quote proglang names --- src/behavior-considered-undefined.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/behavior-considered-undefined.md b/src/behavior-considered-undefined.md index 720aaff2e..5dca31d0b 100644 --- a/src/behavior-considered-undefined.md +++ b/src/behavior-considered-undefined.md @@ -40,10 +40,10 @@ code. * 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. +> 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