Kaydet (Commit) dacc1b40 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Stephan Bergmann

ofz#9597 rethrown IOException not caught by catch IOException

under google oss-fuzz, asan + clang version 6.0.0 (trunk 315613)

when using our own exception thrower, but builtin C++11 support works

also, ofz#9266, ofz#9591, ofz#9597, ofz#9622, etc

Change-Id: I29c692da880b49268284de2f61be07fa94f33bc6
Reviewed-on: https://gerrit.libreoffice.org/58223
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 108d4a63
...@@ -32,7 +32,7 @@ private: ...@@ -32,7 +32,7 @@ private:
catch (const css::uno::Exception &e) catch (const css::uno::Exception &e)
{ {
SAL_WARN("package", "Unexpected " << e ); SAL_WARN("package", "Unexpected " << e );
mxStream.saveException(cppu::getCaughtException()); mxStream.saveException(std::current_exception());
} }
mxStream.setTerminateThread(); mxStream.setTerminateThread();
...@@ -107,8 +107,8 @@ const Buffer& XBufferedThreadedStream::getNextBlock() ...@@ -107,8 +107,8 @@ const Buffer& XBufferedThreadedStream::getNextBlock()
if( maPendingBuffers.empty() ) if( maPendingBuffers.empty() )
{ {
maInUseBuffer = Buffer(); maInUseBuffer = Buffer();
if (maSavedException.hasValue()) if (maSavedException)
cppu::throwException(maSavedException); std::rethrow_exception(maSavedException);
} }
else else
{ {
......
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
std::condition_variable maBufferProduceResume; std::condition_variable maBufferProduceResume;
bool mbTerminateThread; /// indicates the failure of one of the threads bool mbTerminateThread; /// indicates the failure of one of the threads
css::uno::Any maSavedException; /// exception caught during unzipping is saved to be thrown during reading std::exception_ptr maSavedException; /// exception caught during unzipping is saved to be thrown during reading
static const size_t nBufferLowWater = 2; static const size_t nBufferLowWater = 2;
static const size_t nBufferHighWater = 4; static const size_t nBufferHighWater = 4;
...@@ -66,7 +66,7 @@ public: ...@@ -66,7 +66,7 @@ public:
void produce(); void produce();
void setTerminateThread(); void setTerminateThread();
void saveException(const css::uno::Any &rAny) { maSavedException = rAny; } void saveException(std::exception_ptr exception) { maSavedException = exception; }
// XInputStream // XInputStream
virtual sal_Int32 SAL_CALL readBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) override; virtual sal_Int32 SAL_CALL readBytes( css::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment