summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/system/alloc.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim
index 82755ca86..d6093c5b1 100755
--- a/lib/system/alloc.nim
+++ b/lib/system/alloc.nim
@@ -729,7 +729,8 @@ template InstantiateForRegion(allocator: expr) =
     proc interiorAllocatedPtr*(p: pointer): pointer =
       result = interiorAllocatedPtr(allocator, p)
 
-    proc isAllocatedPtr*(p: pointer): bool = 
+    proc isAllocatedPtr*(p: pointer): bool =
+      let p = cast[pointer](cast[TAddress](p)-%TAddress(sizeof(TCell)))
       result = isAllocatedPtr(allocator, p)
 
   proc deallocOsPages = deallocOsPages(allocator)