From 91bcd540c55b4e9a475fd5cef0a1f0320c3bba26 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 2 Sep 2025 18:59:25 +0200 Subject: [PATCH] Use ull integer suffix for bitwise logic 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 0a94adf21305a..ccbccc32f711b 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)); } } }