From efcdda5d3328a22d746b670f1fe17a4c7e0bd0ff Mon Sep 17 00:00:00 2001 From: Konstantin Osipov <kostja@tarantool.org> Date: Sat, 10 Oct 2015 12:12:01 +0300 Subject: [PATCH] arm: the most specific exception type was ignored by raise --- src/box/xlog.h | 2 ++ src/exception.h | 13 ++++--------- src/fiber.h | 1 + src/lua/utils.h | 1 + 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/box/xlog.h b/src/box/xlog.h index d33192fe6d..91c91fcaba 100644 --- a/src/box/xlog.h +++ b/src/box/xlog.h @@ -45,6 +45,7 @@ struct XlogError: public Exception { XlogError(const char *file, unsigned line, const char *format, ...); + virtual void raise() { throw this; } protected: XlogError(const struct type *type, const char *file, unsigned line, const char *format, ...); @@ -55,6 +56,7 @@ struct XlogGapError: public XlogError XlogGapError(const char *file, unsigned line, const struct vclock *from, const struct vclock *to); + virtual void raise() { throw this; } }; /* {{{ log dir */ diff --git a/src/exception.h b/src/exception.h index 577c4f1148..c10e127e36 100644 --- a/src/exception.h +++ b/src/exception.h @@ -43,11 +43,7 @@ class Exception: public diag_msg { public: void *operator new(size_t size); void operator delete(void*); - virtual void raise() - { - /* Throw the most specific type of exception */ - throw this; - } + virtual void raise() = 0; const char * errmsg() const @@ -84,10 +80,7 @@ extern const struct type type_SystemError; class SystemError: public Exception { public: - virtual void raise() - { - throw this; - } + virtual void raise() { throw this; } int errnum() const @@ -119,12 +112,14 @@ class OutOfMemory: public SystemError { OutOfMemory(const char *file, unsigned line, size_t amount, const char *allocator, const char *object); + virtual void raise() { throw this; } }; extern const struct type type_TimedOut; class TimedOut: public SystemError { public: TimedOut(const char *file, unsigned line); + virtual void raise() { throw this; } }; /** \endcond */ diff --git a/src/fiber.h b/src/fiber.h index 0d51e90887..6f9867c43e 100644 --- a/src/fiber.h +++ b/src/fiber.h @@ -98,6 +98,7 @@ class FiberCancelException: public Exception { virtual void log() const { say_debug("FiberCancelException"); } + virtual void raise() { throw this; } }; #endif /* defined(__cplusplus) */ diff --git a/src/lua/utils.h b/src/lua/utils.h index a8420c02da..0d8af06dec 100644 --- a/src/lua/utils.h +++ b/src/lua/utils.h @@ -509,6 +509,7 @@ class LuajitError: public Exception { public: LuajitError(const char *file, unsigned line, struct lua_State *L); + virtual void raise() { throw this; } }; static inline void -- GitLab