Issue40228
Created on 2020-04-08 15:47 by Mark.Shannon, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 19437 | merged | Mark.Shannon, 2020-04-08 15:59 | |
| Messages (3) | |||
|---|---|---|---|
| msg365990 - (view) | Author: Mark Shannon (Mark.Shannon) * | Date: 2020-04-08 15:47 | |
Debuggers are allowed to change the line number of the currently executing frame. Regardless of whether this is sensible or not, the current implementation rather fragile. The code makes various assumptions about the layout of the bytecode that may not be true in the future, and I suspect, are not true now. We should use a more brute-force approach of computing the exception stack for the whole function and then searching for a safe place to jump to. This is not only more robust it allows more jumps. For example, it is safe to jump from one exception handler to another. It may not be sensible, but it is safe. |
|||
| msg367666 - (view) | Author: Mark Shannon (Mark.Shannon) * | Date: 2020-04-29 15:49 | |
New changeset 57697245e1deafdedf68e5f21ad8890be591efc0 by Mark Shannon in branch 'master': bpo-40228: More robust frame.setlineno. (GH-19437) https://github.com/python/cpython/commit/57697245e1deafdedf68e5f21ad8890be591efc0 |
|||
| msg368383 - (view) | Author: STINNER Victor (vstinner) * | Date: 2020-05-07 21:53 | |
Windows 64-bit emits a compiler warning on this line:
int len = PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT);
Warning:
D:\a\cpython\cpython\Objects\frameobject.c(400,1): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
Either the code should be rewritten to to Py_ssize_t, or the result should be downcasted to int.
Technically, it seems possible to create a code object larger than INT_MAX instructors: PyCode_New() has no limit on the bytecode length.
|
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:29 | admin | set | github: 84409 |
| 2021-04-07 09:27:15 | Mark.Shannon | set | status: open -> closed resolution: fixed |
| 2020-05-07 21:53:59 | vstinner | set | status: closed -> open resolution: fixed -> (no value) |
| 2020-05-07 21:53:51 | vstinner | set | nosy:
+ vstinner messages: + msg368383 |
| 2020-05-07 14:03:05 | Mark.Shannon | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-04-29 15:49:49 | Mark.Shannon | set | messages: + msg367666 |
| 2020-04-08 16:02:40 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka |
| 2020-04-08 15:59:37 | Mark.Shannon | set | keywords:
+ patch stage: patch review pull_requests: + pull_request18791 |
| 2020-04-08 15:47:35 | Mark.Shannon | create | |