comparison src/share/vm/adlc/dict2.cpp @ 562:1580954e694c

6798785: Crash in OopFlow::build_oop_map: incorrect comparison of 64bit pointers Reviewed-by: phh, kvn
author never
date Wed, 04 Feb 2009 11:44:57 -0800
parents a61af66fc99e
children 0fbdb4381b99 98cb887364d3
comparison
equal deleted inserted replaced
561:5bfdb08ea692 562:1580954e694c
314 //------------------------------Key Comparator Functions--------------------- 314 //------------------------------Key Comparator Functions---------------------
315 int cmpstr(const void *k1, const void *k2) { 315 int cmpstr(const void *k1, const void *k2) {
316 return strcmp((const char *)k1,(const char *)k2); 316 return strcmp((const char *)k1,(const char *)k2);
317 } 317 }
318 318
319 // Slimey cheap key comparator. 319 // Cheap key comparator.
320 int cmpkey(const void *key1, const void *key2) { 320 int cmpkey(const void *key1, const void *key2) {
321 return (int)((intptr_t)key1 - (intptr_t)key2); 321 if (key1 == key2) return 0;
322 intptr_t delta = (intptr_t)key1 - (intptr_t)key2;
323 if (delta > 0) return 1;
324 return -1;
322 } 325 }
323 326
324 //============================================================================= 327 //=============================================================================
325 //------------------------------reset------------------------------------------ 328 //------------------------------reset------------------------------------------
326 // Create an iterator and initialize the first variables. 329 // Create an iterator and initialize the first variables.