1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024533: Use 0 to check null handle instead of UndefinedHandleAccess

Handle classes now use 0 as invalid value for pointer instead of custom (and platform-dependent) value like 0xfefd0000.
Compiler macros UndefinedHandleAddress and _OCC64 are eliminated.
This commit is contained in:
Roman Lygin
2014-01-23 13:37:50 +04:00
committed by bugmaster
parent 545ef510a7
commit 4d9421a970
8 changed files with 30 additions and 85 deletions

View File

@@ -34,7 +34,6 @@
#include <OSD_SIGSYS.hxx>
#include <OSD_Exception_CTRL_BREAK.hxx>
#include <Standard_NumericError.hxx>
#include <Standard_NullObject.hxx>
#include <Standard_DivideByZero.hxx>
#include <Standard_Overflow.hxx>
@@ -391,10 +390,7 @@ static void SegvHandler(const int theSignal,
sigaddset(&set, SIGSEGV);
sigprocmask (SIG_UNBLOCK, &set, NULL) ;
void *address = ip->si_addr ;
if ( (((long) address )& ~0xffff) == (long) UndefinedHandleAddress ) {
Standard_NullObject::NewInstance("Attempt to access to null object")->Jump();
}
else {
{
char Msg[100];
sprintf(Msg,"SIGSEGV 'segmentation violation' detected. Address %lx",
(long ) address ) ;
@@ -423,10 +419,7 @@ static void SegvHandler(const int theSignal,
Space = ((struct sigcontext *)theContext)->sc_sl.sl_ss.ss_cr20 ;
Offset = ((struct sigcontext *)theContext)->sc_sl.sl_ss.ss_cr21 ;
// cout << "Wrong address = " << hex(Offset) << endl ;
if ((Offset & ~0xffff) == (long)UndefinedHandleAddress) {
Standard_NullObject::Jump("Attempt to access to null object") ;
}
else {
{
sprintf(Msg,"SIGSEGV 'segmentation violation' detected. Address %lx",Offset) ;
OSD_SIGSEGV::Jump(Msg);
// scp->sc_pcoq_head = scp->sc_pcoq_tail ; Permettrait de continuer a