summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-07-18 15:06:42 (GMT)
committerGitHub <noreply@github.com>2022-07-18 15:06:42 (GMT)
commit2f8bff6879c5d76d143068e8bc867196a7d28afc (patch)
treed6d031a15146ed75eb67e735979a80a9715f635a /Include
parent631160c262b40bf4ce3da6cd7bbb972ae2e9fc91 (diff)
downloadcpython-2f8bff6879c5d76d143068e8bc867196a7d28afc.zip
cpython-2f8bff6879c5d76d143068e8bc867196a7d28afc.tar.gz
cpython-2f8bff6879c5d76d143068e8bc867196a7d28afc.tar.bz2
GH-94739: Mark stacks of exception handling blocks for setting frame.f_lineno in the debugger. (GH-94958)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_code.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h
index c975f1c..61e40eb 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -390,6 +390,19 @@ read_obj(uint16_t *p)
return (PyObject *)val;
}
+/* See Objects/exception_handling_notes.txt for details.
+ */
+static inline unsigned char *
+parse_varint(unsigned char *p, int *result) {
+ int val = p[0] & 63;
+ while (p[0] & 64) {
+ p++;
+ val = (val << 6) | (p[0] & 63);
+ }
+ *result = val;
+ return p+1;
+}
+
static inline int
write_varint(uint8_t *ptr, unsigned int val)
{