| 11734 | } |
| 11735 | |
| 11736 | static bool py_facts_owned_range(const CBMArena *arena, const void *ptr, size_t bytes) { |
| 11737 | if (!ptr) |
| 11738 | return bytes == 0; |
| 11739 | uintptr_t address = (uintptr_t)ptr; |
| 11740 | for (int i = 0; i < arena->nblocks; i++) { |
| 11741 | uintptr_t start = (uintptr_t)arena->blocks[i]; |
| 11742 | size_t size = arena->block_sizes[i]; |
| 11743 | if (address >= start && bytes <= size && address - start <= size - bytes) |
| 11744 | return true; |
| 11745 | } |
| 11746 | return false; |
| 11747 | } |
| 11748 | |
| 11749 | static bool py_facts_owned_string(const CBMArena *arena, const char *str) { |
| 11750 | return !str || (py_facts_owned_range(arena, str, 1) && |
no outgoing calls
no test coverage detected