Skip to content

Commit

Permalink
[ci skip] Clarify intention in phpdbg, removing one TODO comment
Browse files Browse the repository at this point in the history
The point of WATCH_ON_BUCKET is to watch for all 3 fields of the bucket,
so the fallthrough is intended.
  • Loading branch information
nielsdos committed Sep 23, 2024
1 parent 1b171bb commit e0a709c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sapi/phpdbg/phpdbg_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ const phpdbg_command_t phpdbg_watch_commands[] = {
bool phpdbg_check_watch_diff(phpdbg_watchtype type, void *oldPtr, void *newPtr) {
switch (type) {
case WATCH_ON_BUCKET:
if (memcmp(&((Bucket *) oldPtr)->h, &((Bucket *) newPtr)->h, sizeof(Bucket) - sizeof(zval) /* key/val comparison */) != 0) {
if (memcmp(&((Bucket *) oldPtr)->h, &((Bucket *) newPtr)->h, sizeof(Bucket) - sizeof(zval) /* hash+key comparison */) != 0) {
return 2;
}
/* TODO: Is this intentional? */
/* Fall through to also compare the value from the bucket. */
ZEND_FALLTHROUGH;
case WATCH_ON_ZVAL:
return memcmp(oldPtr, newPtr, sizeof(zend_value) + sizeof(uint32_t) /* value + typeinfo */) != 0;
Expand Down

0 comments on commit e0a709c

Please sign in to comment.