File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -2615,7 +2615,8 @@ RunResult Thread::DoThrow(Exception::Ptr exn) {
26152615 auto iter = handlers.rbegin ();
26162616 while (iter != handlers.rend ()) {
26172617 const HandlerDesc& handler = *iter;
2618- if (pc >= handler.try_start_offset && pc < handler.try_end_offset ) {
2618+ // pc points to the *next* instruction by the time we're in DoThrow.
2619+ if (pc > handler.try_start_offset && pc <= handler.try_end_offset ) {
26192620 // For a try-delegate, skip part of the traversal by directly going
26202621 // up to an outer handler specified by the delegate depth.
26212622 if (handler.kind == HandlerKind::Delegate) {
Original file line number Diff line number Diff line change 1+ ;;; TOOL: run-interp-spec
2+ ;;; ARGS*: --enable-exceptions
3+ (module
4+ (tag $e0)
5+ (func (export "throws")
6+ (throw $e0)
7+ (try $try
8+ (do
9+ )
10+ (catch $e0)
11+ )
12+ )
13+ )
14+
15+ (assert_exception (invoke "throws"))
16+ (;; STDOUT ;;;
17+ out/test/regress/interp-throw-before-try.txt:15: assert_exception passed
18+ 2/2 tests passed.
19+ ;;; STDOUT ;;)
You can’t perform that action at this time.
0 commit comments