Skip to content

Commit

Permalink
Merge #446
Browse files Browse the repository at this point in the history
446: Correct undefined behavior specification of ffi unwinding r=pietroalbini a=Veykril

Closes #445

Co-authored-by: Lukas Wirth <[email protected]>
  • Loading branch information
bors-ferrocene[bot] and Veykril authored Sep 7, 2023
2 parents c80502f + 5f2bff8 commit 994f2ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/exceptions-and-errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ Invoking :t:`macro` :std:`core::panic` has the following runtime effects:
Control flow of the current thread resumes execution by invoking the
:t:`function` subject to :t:`attribute` :c:`panic_handler`.

.. rubric:: Undefined Behavior

:dp:`fls_krhb07mvojph`
It is undefined behavior when a :t:`panic` crosses a
:t:`foreign function interface` boundary.

.. rubric:: Examples

.. code-block:: rust
Expand Down
9 changes: 8 additions & 1 deletion src/ffi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The following :t:`[ABI]s` are supported:

* :dp:`fls_LfjvLXvI6TFL`
``extern "C-unwind"`` - The same as ``extern "C"`` with the addition that
unwinding across FFI is expected.
unwinding across FFI is permitted.

* :dp:`fls_a2d8ltpgtvn6`
``extern "Rust"`` - The default :t:`ABI` of a Rust program, referred to as
Expand Down Expand Up @@ -114,6 +114,13 @@ include, but may not be limited to, the following:
* :dp:`fls_tyjs1x4j8ovp`
``extern "win64"`` - The x86_64 Windows :t:`ABI` of :t:`C` code.

.. rubric:: Undefined Behavior

:dp:`fls_M4LqHf8hbPA8`
It is undefined behavior when a foreign exception crosses a
:t:`foreign function interface` boundary with an :t:`ABI` other than
``extern "C-unwind"``.

.. rubric:: Examples

.. code-block:: rust
Expand Down

0 comments on commit 994f2ad

Please sign in to comment.