]> git.saurik.com Git - apple/libc.git/blobdiff - gen/stack_logging_disk.c
Libc-594.9.1.tar.gz
[apple/libc.git] / gen / stack_logging_disk.c
index 83c882f81dbff98a6543cb2cf0653f092b878365..aa0bf2852b5bac6b4be674244f6871923e297b3e 100644 (file)
@@ -285,10 +285,13 @@ __expand_uniquing_table(backtrace_uniquing_table *uniquing_table)
 static int 
 __enter_frames_in_table(backtrace_uniquing_table *uniquing_table, uint64_t *foundIndex, mach_vm_address_t *frames, int32_t count)
 {      
+       // The hash values need to be the same size as the addresses (because we use the value -1), for clarity, define a new type
+       typedef mach_vm_address_t hash_index_t;
+
        mach_vm_address_t thisPC;
-       uint64_t hash, uParent = (uint64_t)(-1ll), modulus = (uniquing_table->numNodes-uniquing_table->untouchableNodes-1);
+       hash_index_t hash, uParent = (hash_index_t)(-1ll), modulus = (uniquing_table->numNodes-uniquing_table->untouchableNodes-1);
        int32_t collisions, lcopy = count, returnVal = 1;
-       uint64_t hash_multiplier = ((uniquing_table->numNodes - uniquing_table->untouchableNodes)/(uniquing_table->max_collide*2+1));
+       hash_index_t hash_multiplier = ((uniquing_table->numNodes - uniquing_table->untouchableNodes)/(uniquing_table->max_collide*2+1));
        mach_vm_address_t *node;
        while (--lcopy >= 0) {
         thisPC = frames[lcopy];