Opened 13 years ago

Last modified 13 years ago

#830 closed defect

Disposable::GetHashCode() throws overflow exception on Int64 — at Initial Version

Reported by: gregboone Owned by: gregboone
Priority: major Milestone: 3.7.0
Component: FDO API Version: 3.7.0
Severity: 2 Keywords: GetHashCode
Cc: External ID:

Description

Calling the managed interface function "Disposable::GetHashCode()" can result in an overflow exception if the internal pointer is larger than Int32.

svn diff ...\Fdo\Managed\Src\OSGeo\Runtime\Disposable.cpp

System::Int32 NAMESPACE_OSGEO_RUNTIME::Disposable::GetHashCode() {

  • return m_imp.ToInt32();

+ Solution for overflow issue taken from: + http://msdn.microsoft.com/en-us/library/system.object.gethashcode(v=vs.71).aspx + + System::Int64 i64 = m_imp.ToInt64(); + return ((System::Int32)(i64) (System::Int32)(i64 >> 32));

}

Change History (0)

Note: See TracTickets for help on using tickets.