| @@ -559,7 +559,9 @@ void * __bound_ptr_add(void *p, size_t offset) · 558 unmodified lines |
| 559 | if (tree->is_invalid || addr + offset > tree->size) { | 559 | if (tree->is_invalid || addr + offset > tree->size) { |
| 560 | POST_SEM (); | 560 | POST_SEM (); |
| 561 | if (print_warn_ptr_add) | 561 | if (print_warn_ptr_add) |
| 562 | bound_warning("%p is outside of the region", p + offset); | 562 | bound_warning("%p is outside of the region (0x%lx..0x%lx)", |
| | 563 | p + offset, (long)tree->start, |
| | 564 | (long)(tree->start + tree->size - 1)); |
| 563 | if (never_fatal <= 0) | 565 | if (never_fatal <= 0) |
| 564 | return INVALID_POINTER; /* return an invalid pointer */ | 566 | return INVALID_POINTER; /* return an invalid pointer */ |
| 565 | return p + offset; | 567 | return p + offset; |
| @@ -605,7 +607,9 @@ void * __bound_ptr_indir ## dsize (void *p, size_t offset) \ · 39 unmodified lines |
| 605 | if (addr <= tree->size) { \ | 607 | if (addr <= tree->size) { \ |
| 606 | if (tree->is_invalid || addr + offset + dsize > tree->size) { \ | 608 | if (tree->is_invalid || addr + offset + dsize > tree->size) { \ |
| 607 | POST_SEM (); \ | 609 | POST_SEM (); \ |
| 608 | bound_warning("%p is outside of the region", p + offset); \ | 610 | bound_warning("%p is outside of the region (0x%lx..0x%lx)", \ |
| | 611 | p + offset, (long)tree->start, \ |
| | 612 | (long)(tree->start + tree->size - 1)); \ |
| 609 | if (never_fatal <= 0) \ | 613 | if (never_fatal <= 0) \ |
| 610 | return INVALID_POINTER; /* return an invalid pointer */ \ | 614 | return INVALID_POINTER; /* return an invalid pointer */ \ |
| 611 | return p + offset; \ | 615 | return p + offset; \ |
| @@ -1105,11 +1109,9 @@ add_bounds: · 493 unmodified lines |
| 1105 | while (p[0] != 0) { | 1109 | while (p[0] != 0) { |
| 1106 | tree = splay_insert(p[0], p[1], tree); | 1110 | tree = splay_insert(p[0], p[1], tree); |
| 1107 | #if BOUND_DEBUG | 1111 | #if BOUND_DEBUG |
| 1108 | if (print_calls) { | 1112 | dprintf(stderr, "%s, %s(): static var %p 0x%lx\n", |
| 1109 | dprintf(stderr, "%s, %s(): static var %p 0x%lx\n", | 1113 | __FILE__, __FUNCTION__, |
| 1110 | __FILE__, __FUNCTION__, | 1114 | (void *) p[0], (unsigned long) p[1]); |
| 1111 | (void *) p[0], (unsigned long) p[1]); | | |
| 1112 | } | | |
| 1113 | #endif | 1115 | #endif |
| 1114 | p += 2; | 1116 | p += 2; |
| 1115 | } | 1117 | } |