Skip to content

Commit

Permalink
GH-18 Minor changes related to CATCH.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Aug 22, 2024
1 parent 0175d5b commit db6c8fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/post4.p4
Original file line number Diff line number Diff line change
Expand Up @@ -638,8 +638,8 @@ VARIABLE catch_frame
DEFER _fsp@
DEFER _fsp!

:NONAME $dead ; ' _fsp@ DEFER!
:NONAME DROP ; ' _fsp! DEFER!
' TRUE ' _fsp@ DEFER!
' DROP ' _fsp! DEFER!

\ ... CATCH ...
\
Expand All @@ -652,7 +652,7 @@ DEFER _fsp!
_rsp@ catch_frame ! \ S: xt R: ip ds fs cf
EXECUTE \ S: -- R: ip ds fs cf
R> catch_frame ! \ S: -- R: ip ds fs
2R> 2DROP \ S: -- R: ip
R> R> 2DROP \ S: -- R: ip
0 \ S: 0 R: ip
;

Expand All @@ -665,7 +665,7 @@ DEFER _fsp!
?DUP IF \ S: n R:
\ When no catch frame, throw to C.
catch_frame @ 0= IF \ S: n R:
_abort \ S: -- R: --
_longjmp \ S: -- R: --
THEN
\ Restore return stack of CATCH at EXECUTE.
catch_frame @ _rsp! \ S: n R: ip ds fs cf
Expand Down

0 comments on commit db6c8fc

Please sign in to comment.