Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e53e9eb commit a4709e5Copy full SHA for a4709e5
2 files changed
Include/internal/pycore_stackref.h
@@ -296,6 +296,12 @@ PyStackRef_IsError(_PyStackRef ref)
296
return ref.bits == Py_TAG_INVALID;
297
}
298
299
+static inline bool
300
+PyStackRef_IsMalformed(_PyStackRef ref)
301
+{
302
+ return (ref.bits & Py_TAG_BITS) == Py_TAG_INVALID;
303
+}
304
+
305
static inline bool
306
PyStackRef_IsValid(_PyStackRef ref)
307
{
Python/ceval.c
@@ -160,6 +160,10 @@ dump_item(_PyStackRef item)
160
printf("<NULL>");
161
return;
162
163
+ if (PyStackRef_IsMalformed(item)) {
164
+ printf("<INVALID>");
165
+ return;
166
+ }
167
if (PyStackRef_IsTaggedInt(item)) {
168
printf("%" PRId64, (int64_t)PyStackRef_UntagInt(item));
169
0 commit comments