From 578e6416e71bcd5401bba63e9f3ef25a28258d9a Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 6 May 2021 15:51:47 +0000 Subject: [PATCH] lldb: convert heap_page_obj_limit from a float to int --- misc/lldb_cruby.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py index d16937191f..fa69a9bcad 100755 --- a/misc/lldb_cruby.py +++ b/misc/lldb_cruby.py @@ -545,12 +545,9 @@ class HeapPageIter: def is_valid(self): heap_page_header_size = self.target.FindFirstType("struct heap_page_header").GetByteSize() rvalue_size = self.tRValue.GetByteSize() - heap_page_obj_limit = (HEAP_PAGE_SIZE - heap_page_header_size)/rvalue_size + heap_page_obj_limit = int((HEAP_PAGE_SIZE - heap_page_header_size) / rvalue_size) - if (self.num_slots > heap_page_obj_limit) or (self.num_slots < heap_page_obj_limit - 1): - return False - else: - return True + return (heap_page_obj_limit - 1) <= self.num_slots <= heap_page_obj_limit def __iter__(self): return self