Permalink
Browse files

Fixes #4 (bitrot)

Originally broken by parrot/parrot@56f0d98

This commit reorders things so we don't specifically rely on the parrot
exception type for an error, which allows us to catch both the tcl-style
CONTROL_ERROR, and the new parrot default, EXCEPTION_DIE
  • Loading branch information...
1 parent 0f33083 commit 5561d4df2871edbdc5b15922518834410ddaef54 @coke coke committed Jan 26, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 runtime/builtin/catch.pir
View
@@ -51,13 +51,9 @@ got_retval:
handle_retval:
# We need to convert the code
- if retval != .CONTROL_OK goto handle_error
+ if retval != .CONTROL_OK goto handle_return
retval = .TCL_OK
goto done
-handle_error:
- if retval != .CONTROL_ERROR goto handle_return
- retval = .TCL_ERROR
- goto done
handle_return:
if retval != .CONTROL_RETURN goto handle_break
retval = .TCL_RETURN
@@ -67,7 +63,12 @@ handle_break:
retval = .TCL_BREAK
goto done
handle_continue:
+ if retval != .CONTROL_CONTINUE goto handle_error
retval = .TCL_CONTINUE
+ goto done
+handle_error:
+ # .CONTROL_ERROR (tcl) .EXCEPTION_DIE (parrot), anything else.
+ retval = .TCL_ERROR
done:
if argc != 3 goto return_val

0 comments on commit 5561d4d

Please sign in to comment.