]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/common/common-exceptions.c
Make SJLJ exceptions more efficient
[thirdparty/binutils-gdb.git] / gdb / common / common-exceptions.c
index 59c27ab52d44acfc9a6d4758fcd57756854e8afe..0b96cc679da5a3609e8e082dc7ec22275168fb09 100644 (file)
@@ -166,14 +166,15 @@ exceptions_state_mc_action_iter_1 (void)
 /* Return EXCEPTION to the nearest containing CATCH_SJLJ block.  */
 
 void
-throw_exception_sjlj (struct gdb_exception exception)
+throw_exception_sjlj (const struct gdb_exception &exception)
 {
   /* Jump to the nearest CATCH_SJLJ block, communicating REASON to
      that call via setjmp's return value.  Note that REASON can't be
      zero, by definition in common-exceptions.h.  */
   exceptions_state_mc (CATCH_THROWING);
+  enum return_reason reason = exception.reason;
   catchers.front ().exception = exception;
-  longjmp (catchers.front ().buf, exception.reason);
+  longjmp (catchers.front ().buf, reason);
 }
 
 /* Implementation of throw_exception that uses C++ try/catch.  */