GH-108390: Prevent non-local events being set with sys.monitoring.set_local_events() (GH-108420)

This commit is contained in:
Mark Shannon 2023-09-05 08:03:53 +01:00 committed by GitHub
parent 04a0830b00
commit 5a2a046151
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 143 additions and 74 deletions

View file

@ -29,7 +29,7 @@ extern "C" {
#define PY_MONITORING_EVENT_STOP_ITERATION 9
#define PY_MONITORING_IS_INSTRUMENTED_EVENT(ev) \
((ev) <= PY_MONITORING_EVENT_STOP_ITERATION)
((ev) < _PY_MONITORING_LOCAL_EVENTS)
/* Other events, mainly exceptions */

View file

@ -187,7 +187,7 @@ struct _is {
uint16_t optimizer_resume_threshold;
uint16_t optimizer_backedge_threshold;
_Py_Monitors monitors;
_Py_GlobalMonitors monitors;
bool f_opcode_trace_set;
bool sys_profile_initialized;
bool sys_trace_initialized;