Author skrah
Recipients ammar2, benjamin.peterson, cstratak, gregory.p.smith, mark.dickinson, meador.inge, petr.viktorin, skrah, vstinner
Date 2020-03-11.20:29:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583958582.71.0.447947188827.issue39689@roundup.psfhosted.org>
In-reply-to
Content
Okay, in memoryview the cast tests can trigger UB checks. memoryview assumes that bool is packed correctly, so just casting does not work.
Casting anything to bool is of course a bit silly anyway.

diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index 6178ffde7a..86cf4c309f 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -2758,6 +2758,8 @@ class TestBufferProtocol(unittest.TestCase):
                 tsize = struct.calcsize(tfmt)
                 n = prod(_tshape) * tsize
                 obj = 'memoryview' if is_byte_format(tfmt) else 'bytefmt'
+                if "?" in tfmt:
+                    continue
                 for fmt, items, _ in iter_format(n, obj):
                     size = struct.calcsize(fmt)
                     shape = [n] if n > 0 else []
History
Date User Action Args
2020-03-11 20:29:42skrahsetrecipients: + skrah, gregory.p.smith, mark.dickinson, vstinner, benjamin.peterson, petr.viktorin, meador.inge, cstratak, ammar2
2020-03-11 20:29:42skrahsetmessageid: <1583958582.71.0.447947188827.issue39689@roundup.psfhosted.org>
2020-03-11 20:29:42skrahlinkissue39689 messages
2020-03-11 20:29:42skrahcreate