fix #26038, make isequal
consistent with hash
for Ptr
#26858
Merged
isequal
consistent with hash
for Ptr
#26858