Skip to content

Commit 6a97342

Browse files
committed
Fix sapi/phpdbg
1 parent 1d1177d commit 6a97342

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

sapi/phpdbg/phpdbg_bp.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ PHPDBG_API int phpdbg_resolve_op_array_break(phpdbg_breakopline_t *brake, zend_o
515515
opline_break.disabled = 0;
516516
opline_break.hits = 0;
517517
opline_break.id = brake->id;
518-
opline_break.opline = brake->opline = (zend_ulong)(op_array->opcodes + brake->opline_num);
518+
opline_break.opline = brake->opline = (zend_ulong)((uintptr_t)op_array->opcodes + brake->opline_num);
519519
opline_break.name = NULL;
520520
opline_break.base = brake;
521521
if (op_array->scope) {
@@ -805,21 +805,21 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len)
805805

806806
PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline) /* {{{ */
807807
{
808-
if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) {
808+
if (!zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong)(uintptr_t) opline)) {
809809
phpdbg_breakline_t new_break;
810810

811811
PHPDBG_G(flags) |= PHPDBG_HAS_OPLINE_BP;
812812

813813
PHPDBG_BREAK_INIT(new_break, PHPDBG_BREAK_OPLINE);
814-
new_break.opline = (zend_ulong) opline;
814+
new_break.opline = (zend_ulong)(uintptr_t) opline;
815815
new_break.base = NULL;
816816

817-
zend_hash_index_update_mem(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline, &new_break, sizeof(phpdbg_breakline_t));
817+
zend_hash_index_update_mem(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong)(uintptr_t) opline, &new_break, sizeof(phpdbg_breakline_t));
818818

819819
phpdbg_notice("Breakpoint #%d added at #"ZEND_ULONG_FMT, new_break.id, new_break.opline);
820820
PHPDBG_BREAK_MAPPING(new_break.id, &PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]);
821821
} else {
822-
phpdbg_error("Breakpoint exists for opline #"ZEND_ULONG_FMT, (zend_ulong) opline);
822+
phpdbg_error("Breakpoint exists for opline #"ZEND_ULONG_FMT, (zend_ulong)(uintptr_t) opline);
823823
}
824824
} /* }}} */
825825

@@ -1002,7 +1002,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt
10021002
{
10031003
phpdbg_breakline_t *brake;
10041004

1005-
if ((brake = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong) opline)) && brake->base) {
1005+
if ((brake = zend_hash_index_find_ptr(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (zend_ulong)(uintptr_t) opline)) && brake->base) {
10061006
return (phpdbg_breakbase_t *)brake->base;
10071007
}
10081008

@@ -1082,7 +1082,7 @@ static inline bool phpdbg_find_breakpoint_param(phpdbg_param_t *param, zend_exec
10821082
} break;
10831083

10841084
case ADDR_PARAM: {
1085-
return ((zend_ulong)(phpdbg_opline_ptr_t)execute_data->opline == param->addr);
1085+
return ((zend_ulong)(uintptr_t)execute_data->opline == param->addr);
10861086
} break;
10871087

10881088
default: {

sapi/phpdbg/phpdbg_btree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void phpdbg_btree_branch_dump(phpdbg_btree_branch *branch, zend_ulong depth) {
250250
phpdbg_btree_branch_dump(branch->branches[0], depth);
251251
phpdbg_btree_branch_dump(branch->branches[1], depth);
252252
} else {
253-
fprintf(stderr, "%p: %p\n", (void *) branch->result.idx, branch->result.ptr);
253+
fprintf(stderr, "%p: %p\n", (void *)(intptr_t) branch->result.idx, branch->result.ptr);
254254
}
255255
}
256256
}

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ int phpdbg_skip_line_helper(void) /* {{{ */ {
591591
|| opline->opcode == ZEND_YIELD
592592
|| opline->opcode == ZEND_YIELD_FROM
593593
) {
594-
zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong) opline, (void *) opline);
594+
zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) opline, (void *) opline);
595595
}
596596
} while (++opline < op_array->opcodes + op_array->last);
597597

@@ -633,7 +633,7 @@ static void phpdbg_seek_to_end(void) /* {{{ */ {
633633
case ZEND_GENERATOR_RETURN:
634634
case ZEND_YIELD:
635635
case ZEND_YIELD_FROM:
636-
zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong) opline, (void *) opline);
636+
zend_hash_index_update_ptr(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) opline, (void *) opline);
637637
}
638638
} while (++opline < op_array->opcodes + op_array->last);
639639
}
@@ -647,7 +647,7 @@ PHPDBG_COMMAND(finish) /* {{{ */
647647
}
648648

649649
phpdbg_seek_to_end();
650-
if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong) phpdbg_user_execute_data(EG(current_execute_data))->opline)) {
650+
if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) phpdbg_user_execute_data(EG(current_execute_data))->opline)) {
651651
zend_hash_clean(&PHPDBG_G(seek));
652652
} else {
653653
PHPDBG_G(flags) |= PHPDBG_IN_FINISH;
@@ -664,7 +664,7 @@ PHPDBG_COMMAND(leave) /* {{{ */
664664
}
665665

666666
phpdbg_seek_to_end();
667-
if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong) phpdbg_user_execute_data(EG(current_execute_data))->opline)) {
667+
if (zend_hash_index_exists(&PHPDBG_G(seek), (zend_ulong)(uintptr_t) phpdbg_user_execute_data(EG(current_execute_data))->opline)) {
668668
zend_hash_clean(&PHPDBG_G(seek));
669669
phpdbg_notice("Already at the end of the function");
670670
return SUCCESS;
@@ -1713,7 +1713,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
17131713
/* perform seek operation */
17141714
if ((PHPDBG_G(flags) & PHPDBG_SEEK_MASK) && !(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {
17151715
/* current address */
1716-
zend_ulong address = (zend_ulong) execute_data->opline;
1716+
zend_ulong address = (zend_ulong)(uintptr_t) execute_data->opline;
17171717

17181718
if (PHPDBG_G(seek_ex) != execute_data) {
17191719
if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) {

sapi/phpdbg/phpdbg_watch.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void phpdbg_print_watch_diff(phpdbg_watchtype type, zend_string *name, void *old
218218
/* ### LOW LEVEL WATCHPOINT HANDLING ### */
219219
static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(phpdbg_btree *tree, void *addr) {
220220
phpdbg_watchpoint_t *watch;
221-
phpdbg_btree_result *result = phpdbg_btree_find_closest(tree, (zend_ulong) phpdbg_get_page_boundary(addr) + phpdbg_pagesize - 1);
221+
phpdbg_btree_result *result = phpdbg_btree_find_closest(tree, (zend_ulong)(uintptr_t) phpdbg_get_page_boundary(addr) + phpdbg_pagesize - 1);
222222

223223
if (result == NULL) {
224224
return NULL;
@@ -301,7 +301,7 @@ int phpdbg_watchpoint_segfault_handler(siginfo_t *info, void *context) {
301301
/* re-enable writing */
302302
mprotect(page, phpdbg_pagesize, PROT_READ | PROT_WRITE);
303303

304-
zend_hash_index_add_empty_element(PHPDBG_G(watchlist_mem), (zend_ulong) page);
304+
zend_hash_index_add_empty_element(PHPDBG_G(watchlist_mem), (zend_ulong)(uintptr_t) page);
305305

306306
return SUCCESS;
307307
}
@@ -317,7 +317,7 @@ void *phpdbg_watchpoint_userfaultfd_thread(void *phpdbg_globals_ptr) {
317317
struct uffd_msg fault_msg = {0};
318318
while (read(globals->watch_userfaultfd, &fault_msg, sizeof(fault_msg)) == sizeof(fault_msg)) {
319319
void *page = phpdbg_get_page_boundary((char *)(uintptr_t) fault_msg.arg.pagefault.address);
320-
zend_hash_index_add_empty_element(globals->watchlist_mem, (zend_ulong) page);
320+
zend_hash_index_add_empty_element(globals->watchlist_mem, (zend_ulong)(uintptr_t) page);
321321
struct uffdio_writeprotect unprotect = {
322322
.mode = 0,
323323
.range = {
@@ -335,14 +335,14 @@ void *phpdbg_watchpoint_userfaultfd_thread(void *phpdbg_globals_ptr) {
335335
/* ### REGISTER WATCHPOINT ### To be used only by watch element and collision managers ### */
336336
static inline void phpdbg_store_watchpoint_btree(phpdbg_watchpoint_t *watch) {
337337
#if ZEND_DEBUG
338-
phpdbg_btree_result *res = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr);
338+
phpdbg_btree_result *res = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong)(uintptr_t) watch->addr.ptr);
339339
ZEND_ASSERT(res == NULL || res->ptr == watch);
340340
#endif
341-
phpdbg_btree_insert(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr, watch);
341+
phpdbg_btree_insert(&PHPDBG_G(watchpoint_tree), (zend_ulong)(uintptr_t) watch->addr.ptr, watch);
342342
}
343343

344344
static inline void phpdbg_remove_watchpoint_btree(phpdbg_watchpoint_t *watch) {
345-
phpdbg_btree_delete(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr);
345+
phpdbg_btree_delete(&PHPDBG_G(watchpoint_tree), (zend_ulong)(uintptr_t) watch->addr.ptr);
346346
}
347347

348348
/* ### SET WATCHPOINT ADDR ### To be used only by watch element and collision managers ### */
@@ -394,8 +394,8 @@ void phpdbg_watch_backup_data(phpdbg_watchpoint_t *watch) {
394394
/* watch collisions are responsible for having only one watcher on a given refcounted/refval and having a mapping back to the parent zvals */
395395
void phpdbg_delete_watch_collision(phpdbg_watchpoint_t *watch) {
396396
phpdbg_watch_collision *coll;
397-
if ((coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref))) {
398-
zend_hash_index_del(&coll->parents, (zend_ulong) watch);
397+
if ((coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref))) {
398+
zend_hash_index_del(&coll->parents, (zend_ulong)(uintptr_t) watch);
399399
if (zend_hash_num_elements(&coll->parents) == 0) {
400400
phpdbg_remove_watchpoint_btree(&coll->ref);
401401
phpdbg_deactivate_watchpoint(&coll->ref);
@@ -411,7 +411,7 @@ void phpdbg_delete_watch_collision(phpdbg_watchpoint_t *watch) {
411411
}
412412
}
413413

414-
zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref);
414+
zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref);
415415
zend_hash_destroy(&coll->parents);
416416
efree(coll);
417417
}
@@ -433,7 +433,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
433433

434434
watch->ref = Z_COUNTED_P(watch->addr.zv);
435435

436-
if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref))) {
436+
if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref))) {
437437
coll = emalloc(sizeof(*coll));
438438
coll->ref.type = WATCH_ON_REFCOUNTED;
439439
phpdbg_set_addr_watchpoint(Z_COUNTED_P(watch->addr.zv), sizeof(uint32_t), &coll->ref);
@@ -462,9 +462,9 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
462462
}
463463

464464
zend_hash_init(&coll->parents, 8, NULL, NULL, 0);
465-
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll);
465+
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref, coll);
466466
}
467-
zend_hash_index_add_ptr(&coll->parents, (zend_long) watch, watch);
467+
zend_hash_index_add_ptr(&coll->parents, (zend_long)(uintptr_t) watch, watch);
468468
} else if (Z_TYPE_P(watch->addr.zv) == IS_INDIRECT) {
469469
if ((zend_refcounted *) Z_INDIRECT_P(watch->addr.zv) == watch->ref) {
470470
return;
@@ -476,7 +476,7 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
476476

477477
watch->ref = (zend_refcounted *) Z_INDIRECT_P(watch->addr.zv);
478478

479-
if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref))) {
479+
if (!(coll = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref))) {
480480
coll = emalloc(sizeof(*coll));
481481
phpdbg_set_zval_watchpoint(Z_INDIRECT_P(watch->addr.zv), &coll->ref);
482482
coll->ref.coll = coll;
@@ -486,9 +486,9 @@ void phpdbg_update_watch_ref(phpdbg_watchpoint_t *watch) {
486486
phpdbg_watch_backup_data(&coll->ref);
487487

488488
zend_hash_init(&coll->parents, 8, NULL, NULL, 0);
489-
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) watch->ref, coll);
489+
zend_hash_index_add_ptr(&PHPDBG_G(watch_collisions), (zend_ulong)(uintptr_t) watch->ref, coll);
490490
}
491-
zend_hash_index_add_ptr(&coll->parents, (zend_long) watch, watch);
491+
zend_hash_index_add_ptr(&coll->parents, (zend_long)(uintptr_t) watch, watch);
492492
} else if (watch->ref) {
493493
phpdbg_delete_watch_collision(watch);
494494
watch->ref = NULL;
@@ -505,7 +505,7 @@ void phpdbg_watch_parent_ht(phpdbg_watch_element *element);
505505

506506
phpdbg_watch_element *phpdbg_add_watch_element(phpdbg_watchpoint_t *watch, phpdbg_watch_element *element) {
507507
phpdbg_btree_result *res;
508-
if ((res = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr)) == NULL) {
508+
if ((res = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong)(uintptr_t) watch->addr.ptr)) == NULL) {
509509
phpdbg_watchpoint_t *mem = emalloc(sizeof(*mem));
510510
*mem = *watch;
511511
watch = mem;
@@ -647,12 +647,12 @@ void phpdbg_watch_parent_ht(phpdbg_watch_element *element) {
647647
phpdbg_btree_result *res;
648648
phpdbg_watch_ht_info *hti;
649649
ZEND_ASSERT(element->parent_container);
650-
if (!(res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong) element->parent_container))) {
650+
if (!(res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong)(uintptr_t) element->parent_container))) {
651651
hti = emalloc(sizeof(*hti));
652652
hti->ht = element->parent_container;
653653

654654
zend_hash_init(&hti->watches, 0, NULL, ZVAL_PTR_DTOR, 0);
655-
phpdbg_btree_insert(&PHPDBG_G(watch_HashTables), (zend_ulong) hti->ht, hti);
655+
phpdbg_btree_insert(&PHPDBG_G(watch_HashTables), (zend_ulong)(uintptr_t) hti->ht, hti);
656656

657657
phpdbg_set_addr_watchpoint(HT_GET_DATA_ADDR(hti->ht), HT_HASH_SIZE(hti->ht->nTableMask), &hti->hash_watch);
658658
hti->hash_watch.type = WATCH_ON_HASHDATA;
@@ -668,14 +668,14 @@ void phpdbg_watch_parent_ht(phpdbg_watch_element *element) {
668668

669669
void phpdbg_unwatch_parent_ht(phpdbg_watch_element *element) {
670670
if (element->watch && element->watch->type == WATCH_ON_BUCKET) {
671-
phpdbg_btree_result *res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong) element->parent_container);
671+
phpdbg_btree_result *res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong)(uintptr_t) element->parent_container);
672672
ZEND_ASSERT(element->parent_container);
673673
if (res) {
674674
phpdbg_watch_ht_info *hti = res->ptr;
675675

676676
if (zend_hash_num_elements(&hti->watches) == 1) {
677677
zend_hash_destroy(&hti->watches);
678-
phpdbg_btree_delete(&PHPDBG_G(watch_HashTables), (zend_ulong) hti->ht);
678+
phpdbg_btree_delete(&PHPDBG_G(watch_HashTables), (zend_ulong)(uintptr_t) hti->ht);
679679
phpdbg_remove_watchpoint_btree(&hti->hash_watch);
680680
phpdbg_deactivate_watchpoint(&hti->hash_watch);
681681
efree(hti);
@@ -712,7 +712,7 @@ void phpdbg_queue_element_for_recreation(phpdbg_watch_element *element) {
712712

713713
if (!element->parent) {
714714
/* HERE BE DRAGONS; i.e. we assume HashTable is directly allocated via emalloc() ... (which *should be* the case for every user-accessible array and symbol tables) */
715-
zend_hash_index_add_empty_element(&PHPDBG_G(watch_free), (zend_ulong) element->parent_container);
715+
zend_hash_index_add_empty_element(&PHPDBG_G(watch_free), (zend_ulong)(uintptr_t) element->parent_container);
716716
}
717717
}
718718

@@ -775,7 +775,7 @@ void phpdbg_dequeue_elements_for_recreation(void) {
775775

776776
ZEND_HASH_MAP_FOREACH_PTR(&PHPDBG_G(watch_recreation), element) {
777777
ZEND_ASSERT(element->flags & (PHPDBG_WATCH_IMPLICIT | PHPDBG_WATCH_RECURSIVE_ROOT | PHPDBG_WATCH_SIMPLE));
778-
if (element->parent || zend_hash_index_find(&PHPDBG_G(watch_free), (zend_ulong) element->parent_container)) {
778+
if (element->parent || zend_hash_index_find(&PHPDBG_G(watch_free), (zend_ulong)(uintptr_t) element->parent_container)) {
779779
zval _zv, *zv = &_zv;
780780
if (element->parent) {
781781
ZEND_ASSERT(element->parent->watch->type == WATCH_ON_ZVAL || element->parent->watch->type == WATCH_ON_BUCKET);
@@ -1019,7 +1019,7 @@ void phpdbg_check_watchpoint(phpdbg_watchpoint_t *watch) {
10191019
zval *zv;
10201020
ZEND_HASH_MAP_FOREACH_PTR(&watch->elements, element) {
10211021
if (element->flags & PHPDBG_WATCH_RECURSIVE) {
1022-
phpdbg_btree_result *res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong) HT_WATCH_HT(watch));
1022+
phpdbg_btree_result *res = phpdbg_btree_find(&PHPDBG_G(watch_HashTables), (zend_ulong)(uintptr_t) HT_WATCH_HT(watch));
10231023
phpdbg_watch_ht_info *hti = res ? res->ptr : NULL;
10241024

10251025
ZEND_HASH_REVERSE_FOREACH_KEY_VAL(HT_WATCH_HT(watch), idx, str, zv) {
@@ -1132,7 +1132,7 @@ void phpdbg_reenable_memory_watches(void) {
11321132
res = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), page + phpdbg_pagesize - 1);
11331133
if (res) {
11341134
watch = res->ptr;
1135-
if ((char *) page < (char *) watch->addr.ptr + watch->size) {
1135+
if ((char *)(uintptr_t) page < (char *) watch->addr.ptr + watch->size) {
11361136
#ifdef HAVE_USERFAULTFD_WRITEFAULT
11371137
if (PHPDBG_G(watch_userfaultfd)) {
11381138
struct uffdio_writeprotect protect = {
@@ -1146,7 +1146,7 @@ void phpdbg_reenable_memory_watches(void) {
11461146
} else
11471147
#endif
11481148
{
1149-
mprotect((void *) page, phpdbg_pagesize, PROT_READ);
1149+
mprotect((void *)(uintptr_t) page, phpdbg_pagesize, PROT_READ);
11501150
}
11511151
}
11521152
}
@@ -1179,7 +1179,7 @@ int phpdbg_print_changed_zvals(void) {
11791179
}
11801180
if ((res = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), page - 1))) {
11811181
watch = res->ptr;
1182-
if ((char *) page < (char *) watch->addr.ptr + watch->size) {
1182+
if ((char *)(uintptr_t) page < (char *) watch->addr.ptr + watch->size) {
11831183
phpdbg_check_watchpoint(watch);
11841184
}
11851185
}
@@ -1206,7 +1206,7 @@ void phpdbg_watch_efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) {
12061206

12071207
/* only do expensive checks if there are any watches at all */
12081208
if (zend_hash_num_elements(&PHPDBG_G(watch_elements))) {
1209-
if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) ptr))) {
1209+
if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong)(uintptr_t) ptr))) {
12101210
phpdbg_watchpoint_t *watch = result->ptr;
12111211
if (watch->type != WATCH_ON_HASHDATA) {
12121212
phpdbg_remove_watchpoint(watch);
@@ -1226,14 +1226,14 @@ void phpdbg_watch_efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) {
12261226
}
12271227

12281228
/* special case watchpoints as they aren't on ptr but on ptr + HT_WATCH_OFFSET */
1229-
if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), HT_WATCH_OFFSET + (zend_ulong) ptr))) {
1229+
if ((result = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), HT_WATCH_OFFSET + (zend_ulong)(uintptr_t) ptr))) {
12301230
phpdbg_watchpoint_t *watch = result->ptr;
12311231
if (watch->type == WATCH_ON_HASHTABLE) {
12321232
phpdbg_remove_watchpoint(watch);
12331233
}
12341234
}
12351235

1236-
zend_hash_index_del(&PHPDBG_G(watch_free), (zend_ulong) ptr);
1236+
zend_hash_index_del(&PHPDBG_G(watch_free), (zend_ulong)(uintptr_t) ptr);
12371237
}
12381238

12391239
if (PHPDBG_G(original_free_function)) {

0 commit comments

Comments
 (0)