]> granicus.if.org Git - python/commitdiff
bpo-38205: Py_UNREACHABLE() calls Py_FatalError() (GH-16290) (GH-16306)
authorVictor Stinner <vstinner@redhat.com>
Fri, 20 Sep 2019 21:36:32 +0000 (23:36 +0200)
committerGitHub <noreply@github.com>
Fri, 20 Sep 2019 21:36:32 +0000 (23:36 +0200)
(cherry picked from commit b1542583bee204130934c2b90684041e29378250)

Include/pymacro.h
Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst [new file with mode: 0644]

index 1890619099a35b121ee52844b1f229a8899204f7..495c2c25c90866de20e8607c7e7b77bb438bf503 100644 (file)
 #  define Py_UNUSED(name) _unused_ ## name
 #endif
 
-#define Py_UNREACHABLE() abort()
+#define Py_UNREACHABLE() \
+    Py_FatalError("Unreachable C code path reached")
 
 #endif /* Py_PYMACRO_H */
diff --git a/Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst b/Misc/NEWS.d/next/C API/2019-09-19-18-26-29.bpo-38205.Db1OJL.rst
new file mode 100644 (file)
index 0000000..1818e54
--- /dev/null
@@ -0,0 +1 @@
+The :c:func:`Py_UNREACHABLE` macro now calls :c:func:`Py_FatalError`.