summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_code.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_code.h')
-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 9528c89..3a24a65 100644
--- a/Include/internal/pycore_code.h
+++ b/Include/internal/pycore_code.h
@@ -438,6 +438,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)
{