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 Mar 27, 2023
1 parent 23b91c0 commit f0cea88
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 f0cea88

Please sign in to comment.