Skip to content

Commit

Permalink
Fix unwind offset value in return-from and go compilation (euslisp#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
Affonso-Gui committed Oct 31, 2022
1 parent b896e81 commit 3d977d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lisp/comp/trans.l
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,17 @@
(send self :store "w") ;save result
(send self :reset-vsp)
(if need-unwind
(maybe-format cfile " unwind(ctx,local+~d);~%" k))
(if (zerop k)
(maybe-format cfile " unwind(ctx,local-1);~%")
(maybe-format cfile " unwind(ctx,local+~d);~%" (1- k))))
(maybe-format cfile " local[~d]=w;~%" k)
(inc pushcount))
(:go-tag (k need-unwind)
(send self :reset-vsp)
(if need-unwind
(maybe-format cfile " unwind(ctx,local+~d);~%" k))
(if (zerop k)
(maybe-format cfile " unwind(ctx,local-1);~%")
(maybe-format cfile " unwind(ctx,local+~d);~%" (1- k))))
(inc pushcount))
(:closure (lab env0 env1)
(if env1
Expand Down

0 comments on commit 3d977d0

Please sign in to comment.