From 29a6ee77f3db3492c83a1da3262b7ddd7914cd8e Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 20 Oct 2017 11:30:22 -0700 Subject: [PATCH] Remove the definition of "safe". `stack_addr` and unrestricted loads and stores *can* be used with entirely defined behavior. The sense in which they're not "safe" is only that it's possible to misuse them. This subtlety wasn't captured in the definition of "safe" here, so for now, just remove the definition so that it doesn't cause confusion. --- cranelift/docs/langref.rst | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/cranelift/docs/langref.rst b/cranelift/docs/langref.rst index 667bfcd3b3..fb9f35fd94 100644 --- a/cranelift/docs/langref.rst +++ b/cranelift/docs/langref.rst @@ -497,8 +497,8 @@ about because stack slots and offsets are fixed at compile time. For example, the alignment of these stack memory accesses can be inferred from the offsets and stack slot alignments. -It can be necessary to escape from the :term:`safety` of the restricted -instructions by taking the address of a stack slot. +It's also possible to obtain the address of a stack slot, which can be used +in :ref:`unrestricted loads and stores `. .. autoinst:: stack_addr @@ -1113,15 +1113,6 @@ Glossary intermediate representation. Cretonne's IR can be converted to text losslessly. - safe - safety - Execution of exclusively defined behavior. Safe programs cannot - read, write, or execute memory outside of heaps, globals, stack - regions, and functions that have been explicitly provided to them. In - some instances, defined behavior can be nondeterministic, where the - specific behavior may vary among a bounded set of possibilities. - Execution of undefined behavior is unsafe. - stack slot A fixed size memory allocation in the current function's activation frame. Also called a local variable.