Ticket #317 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Smart pointer methods in ptr.h throw nothing

Reported by: hugueswski Owned by: BruceDechant
Priority: high Milestone: 2.1
Component: Server Version: 2.0.0
Severity: critical Keywords:
Cc: External ID: 1075218

Description

The throw of nothing is causing some problems in a sevral methods, like this one:

#ifdef _WIN32

T** operator&() throw(...)

#else

T** operator&()

#endif

{

if (p!=NULL)

throw; // ::Create(MgException::NLSGetMessage(_NLSID(_2_BADPARAMETER)));

return &p;

}

Notice that the throw statements are actually rethrow statements - these can't be caught by any catch statement. Here is a little test app showing that you can't catch this kind of throw statement even with catch(…). You always crash with an unhandled exception.

void f() throw(...) {

throw;

}

int main(int, char **) {

try {

f();

} catch(...) {

::std::cerr << "Caught an exception" << ::std::endl;

} return 1;

}

Change History

Changed 5 years ago by hugueswski

  • priority changed from medium to high
  • external_id set to 1048731
  • severity changed from major to critical

Changed 5 years ago by hugueswski

  • external_id changed from 1048731 to 1075218

Changed 5 years ago by BruceDechant

  • owner set to BruceDechant
  • status changed from new to assigned

Changed 5 years ago by BruceDechant

  • status changed from assigned to closed
  • version set to 2.0.0
  • resolution set to fixed
  • milestone set to 2.1
Note: See TracTickets for help on using tickets.