Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mark functions as NORETURN that always raise a C++ exception

  • Loading branch information...
commit 546a7fc0529a758021f82111af0e827d6eb3ad6b 1 parent 4dadf54
@dbussink dbussink authored
Showing with 22 additions and 22 deletions.
  1. +19 −19 vm/builtin/exception.hpp
  2. +3 −3 vm/exception.hpp
View
38 vm/builtin/exception.hpp
@@ -46,30 +46,30 @@ namespace rubinius {
static Exception* make_encoding_compatibility_error(STATE, Object* a, Object* b);
static Exception* make_frozen_exception(STATE, Object* obj);
- static void argument_error(STATE, int expected, int given);
- static void argument_error(STATE, const char* reason);
- static void regexp_error(STATE, const char* reason);
- static void type_error(STATE, const char* reason);
- static void type_error(STATE, object_type type, Object* object,
- const char* reason = NULL);
+ NORETURN(static void argument_error(STATE, int expected, int given));
+ NORETURN(static void argument_error(STATE, const char* reason));
+ NORETURN(static void regexp_error(STATE, const char* reason));
+ NORETURN(static void type_error(STATE, const char* reason));
+ NORETURN(static void type_error(STATE, object_type type, Object* object,
+ const char* reason = NULL));
static void type_error(STATE, const char* reason, CallFrame* call_frame);
- static void float_domain_error(STATE, const char* reason = NULL);
- static void zero_division_error(STATE, const char* reason = NULL);
- static void io_error(STATE, const char* reason);
- static void range_error(STATE, const char* reason);
- static void runtime_error(STATE, const char* reason);
+ NORETURN(static void float_domain_error(STATE, const char* reason = NULL));
+ NORETURN(static void zero_division_error(STATE, const char* reason = NULL));
+ NORETURN(static void io_error(STATE, const char* reason));
+ NORETURN(static void range_error(STATE, const char* reason));
+ NORETURN(static void runtime_error(STATE, const char* reason));
- static void assertion_error(STATE, const char* reason = NULL);
- static void object_bounds_exceeded_error(STATE, Object* obj, int index);
- static void object_bounds_exceeded_error(STATE, const char* reason);
+ NORETURN(static void assertion_error(STATE, const char* reason = NULL));
+ NORETURN(static void object_bounds_exceeded_error(STATE, Object* obj, int index));
+ NORETURN(static void object_bounds_exceeded_error(STATE, const char* reason));
/** Raise a SystemCallError with given message. */
- static void system_call_error(STATE, const char* reason);
- static void system_call_error(STATE, const std::string& reason);
+ NORETURN(static void system_call_error(STATE, const char* reason));
+ NORETURN(static void system_call_error(STATE, const std::string& reason));
- static void thread_error(STATE, const char* reason);
- static void fiber_error(STATE, const char* reason);
- static void memory_error(STATE);
+ NORETURN(static void thread_error(STATE, const char* reason));
+ NORETURN(static void fiber_error(STATE, const char* reason));
+ NORETURN(static void memory_error(STATE));
static Exception* make_lje(STATE, CallFrame* frame);
View
6 vm/exception.hpp
@@ -72,7 +72,7 @@ namespace rubinius {
/**
* Throws an Assertion exception with explanation +reason+.
*/
- static void raise(const char* reason);
+ NORETURN(static void raise(const char* reason));
};
class TypeError : public VMException {
@@ -88,7 +88,7 @@ namespace rubinius {
public: /* Interface */
- static void raise(object_type type, Object* obj, const char* reason = NULL);
+ NORETURN(static void raise(object_type type, Object* obj, const char* reason = NULL));
};
/**
@@ -108,7 +108,7 @@ namespace rubinius {
public: /* Interface */
- static void raise(Exception* exception, bool make_backtrace = false);
+ NORETURN(static void raise(Exception* exception, bool make_backtrace = false));
/**
* Prints out the exception message and the Ruby backtrace.
Please sign in to comment.
Something went wrong with that request. Please try again.