10000 gh-119786: move exception handling doc to InternalDocs by iritkatriel · Pull Request #119815 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-119786: move exception handling doc to InternalDocs #119815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 3, 2024
Prev Previous commit
Next Next commit
fix markup
  • Loading branch information
iritkatriel committed May 31, 2024
commit e93a253d93e99c50e9e3e14cd64b8206b1b1679f
5 changes: 4 additions & 1 deletion InternalDocs/exception_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ Also, sizes are limited to 2**30 as the code length cannot exceed 2**31 and each
It also happens that depth is generally quite small.

So, we need to encode:
```
`start` (up to 30 bits)
`size` (up to 30 bits)
`target` (up to 30 bits)
`depth` (up to ~8 bits)
`lasti` (1 bit)
```

We need a marker for the start of the entry, so the first byte of entry will have the most significant bit set.
Since the most significant bit is reserved for marking the start of an entry, we have 7 bits per byte to encode offsets.
Expand All @@ -157,16 +159,17 @@ is encoded by first converting to the more compact four value form:
```

which is then encoded as:
```
148 (MSB + 20 for start)
8 (size)
65 (Extend bit + 1)
36 (Remainder of target, 100 == (1<<6)+36)
6
```

for a total of five bytes.



Script to parse the exception table
-----------------------------------

Expand Down
0