Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6431341

PreserveExceptionMark clears file/line before saving them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 6
    • hotspot
    • None
    • generic
    • generic

      This is the constructor:

        PreserveExceptionMark::PreserveExceptionMark(Thread*& thread) {
          thread = Thread::current();
          _thread = thread;
          _preserved_exception_oop = Handle(thread, _thread->pending_exception());
          _thread->clear_pending_exception(); // Needed to avoid infinite recursion
          _preserved_exception_line = _thread->exception_line();
          _preserved_exception_file = _thread->exception_file();
        }

      File and line are saved after they have been cleared.

      Also, thread, is reference parameter which set is both non-intuitive and not in the style of HotSpot. However, this is needed with the primary usage via this macro:

         #define PRESERVE_EXCEPTION_MARK Thread* THREAD; PreserveExceptionMark __em(THREAD);

      Finally, the comment, on clear the pending exception appears to be incorrect.

            Unassigned Unassigned
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: