8000 GH-94739: Mark stacks in exception handlers. by markshannon · Pull Request #94958 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-94739: Mark stacks in exception handlers. #94958

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move common code to shared header.
  • Loading branch information
markshannon committed Jul 18, 2022
commit ab358d25a72f27ffa195b924e4e373cc26af46d8
13 changes: 13 additions & 0 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
16 changes: 0 additions & 16 deletions Objects/frameobject.c
< 8000 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -249,22 +249,6 @@ print_stacks(int64_t *stacks, int n) {

#endif

/* Exception table parsing helpers.
* 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 int64_t *
mark_stacks(PyCodeObject *code_obj, int len)
{
Expand Down
14 changes: 0 additions & 14 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -6089,20 +6089,6 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co,

}

/* Exception table parsing code.
* 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 unsigned char *
scan_back_to_entry_start(unsigned char *p) {
Expand Down
0