Skip to content

Commit cf96793

Browse files
authored
Merge branch 'main' into list_subscr
2 parents 83e1296 + 3831752 commit cf96793

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Include/cpython/pystats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#define PYSTATS_MAX_UOP_ID 1024
3333

34-
#define SPECIALIZATION_FAILURE_KINDS 50
34+
#define SPECIALIZATION_FAILURE_KINDS 60
3535

3636
/* Stats for determining who is calling PyEval_EvalFrame */
3737
#define EVAL_CALL_TOTAL 0

Python/specialize.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ _Py_PrintSpecializationStats(int to_file)
440440
#define SPECIALIZATION_FAIL(opcode, kind) \
441441
do { \
442442
if (_Py_stats) { \
443-
_Py_stats->opcode_stats[opcode].specialization.failure_kinds[kind]++; \
443+
int _kind = (kind); \
444+
assert(_kind < SPECIALIZATION_FAILURE_KINDS); \
445+
_Py_stats->opcode_stats[opcode].specialization.failure_kinds[_kind]++; \
444446
} \
445447
} while (0)
446448

0 commit comments

Comments
 (0)