Skip to content

Commit d7c1403

Browse files
committed
Clamp lower range of histogram as well
1 parent 69a6e7b commit d7c1403

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/internal/pycore_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ extern int _PyStaticCode_Init(PyCodeObject *co);
288288
#define OPT_HIST(length, name) \
289289
do { \
290290
if (_Py_stats) { \
291-
int bucket = _Py_bit_length(length - 1); \
291+
int bucket = _Py_bit_length(length >= 1 ? length - 1 : 0); \
292292
bucket = (bucket >= _Py_UOP_HIST_SIZE) ? _Py_UOP_HIST_SIZE - 1 : bucket; \
293293
_Py_stats->optimization_stats.name[bucket]++; \
294294
} \

0 commit comments

Comments
 (0)