From 8a4cbde8c7c95ecbdf7213ffcdb613d554853fb6 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 3 Sep 2025 13:29:12 +0200 Subject: [PATCH] Use ull integer suffix for bitwise logic (GH-19673) If (brake->type+1) exeeds 30, we have undefined behavior and won't actually remove the relevant bit. See GH-19633 --- sapi/phpdbg/phpdbg_bp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index 0a94adf2130..ccbccc32f71 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -1206,14 +1206,14 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num) /* {{{ */ name = estrdup(brake->name); name_len = strlen(name); if (zend_hash_num_elements(&PHPDBG_G(bp)[type]) == 1) { - PHPDBG_G(flags) &= ~(1<<(brake->type+1)); + PHPDBG_G(flags) &= ~(1ull<<(brake->type+1)); } } break; default: { if (zend_hash_num_elements(table) == 1) { - PHPDBG_G(flags) &= ~(1<<(brake->type+1)); + PHPDBG_G(flags) &= ~(1ull<<(brake->type+1)); } } }