MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / isPtrReadable

Method isPtrReadable

KittyMemoryEx/KittyPtrValidator.cpp:243–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241#endif
242
243bool KittyPtrValidator::isPtrReadable(uintptr_t ptr, size_t len)
244{
245 if (ptr == 0 || ptr + len < ptr)
246 return false;
247
248 ptr = KittyUtils::untagHeepPtr(ptr);
249
250 uintptr_t end = ptr + len;
251 RegionInfo region(0, 0, false, false, false);
252 while (region.end < end)
253 {
254 if (!_findRegion(ptr, &region) || !region.readable)
255 return false;
256
257 ptr = region.end;
258 }
259
260 return true;
261}
262
263bool KittyPtrValidator::isPtrWritable(uintptr_t ptr, size_t len)
264{

Callers

nothing calls this directly

Calls 1

untagHeepPtrFunction · 0.85

Tested by

no test coverage detected