6798785: Crash in OopFlow::build_oop_map: incorrect comparison of 64bit pointers
Reviewed-by: phh, kvn
This commit is contained in:
parent
c46f747070
commit
a70da64c72
@ -316,9 +316,12 @@ int cmpstr(const void *k1, const void *k2) {
|
|||||||
return strcmp((const char *)k1,(const char *)k2);
|
return strcmp((const char *)k1,(const char *)k2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slimey cheap key comparator.
|
// Cheap key comparator.
|
||||||
int cmpkey(const void *key1, const void *key2) {
|
int cmpkey(const void *key1, const void *key2) {
|
||||||
return (int)((intptr_t)key1 - (intptr_t)key2);
|
if (key1 == key2) return 0;
|
||||||
|
intptr_t delta = (intptr_t)key1 - (intptr_t)key2;
|
||||||
|
if (delta > 0) return 1;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -346,9 +346,12 @@ int32 cmpstr(const void *k1, const void *k2) {
|
|||||||
return strcmp((const char *)k1,(const char *)k2);
|
return strcmp((const char *)k1,(const char *)k2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slimey cheap key comparator.
|
// Cheap key comparator.
|
||||||
int32 cmpkey(const void *key1, const void *key2) {
|
int32 cmpkey(const void *key1, const void *key2) {
|
||||||
return (int32)((intptr_t)key1 - (intptr_t)key2);
|
if (key1 == key2) return 0;
|
||||||
|
intptr_t delta = (intptr_t)key1 - (intptr_t)key2;
|
||||||
|
if (delta > 0) return 1;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user