aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-opt.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/g-opt.boot')
-rw-r--r--src/interp/g-opt.boot6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index ad2cff91..3557f554 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -145,13 +145,17 @@ changeThrowToGo(s,g) ==
++ Change any `(THROW tag (%return expr))' in x to just
++ `(%return expr) since a return-operator transfer control
-++ out of the function body anyway.
+++ out of the function body anyway. Similarly, transform
+++ reudant `(THROW tag (THROW tag expr))' to `(THROW tag expr)'.
removeNeedlessThrow x ==
isAtomicForm x => x
x is ['THROW,.,y] and y is ['%return,:.] =>
removeNeedlessThrow third y
x.op := y.op
x.args := y.args
+ x is ['THROW,g,y] and y is ['THROW,=g,z] =>
+ removeNeedlessThrow z
+ second(x.args) := z
for x' in x repeat
removeNeedlessThrow x'