File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -3780,7 +3780,9 @@ f(x) = yt(x)
37803780 (let* ((x (if rett
37813781 (compile (convert-for-type-decl x rett) '() #t #f)
37823782 x))
3783- (tmp (if (valid-ir-return? x) #f (make-ssavalue))))
3783+ (tmp (if ((if (null? catch-token-stack) valid-ir-return? simple-atom?) x)
3784+ #f
3785+ (make-ssavalue))))
37843786 (if tmp (emit `(= ,tmp ,x)))
37853787 (let ((pexc (pop-exc-expr catch-token-stack '())))
37863788 (if pexc (emit pexc)))
Original file line number Diff line number Diff line change @@ -383,3 +383,18 @@ function f36527()
383383end
384384
385385@test f36527 ()
386+
387+ # accessing an undefined var in tail position in a catch block
388+ function undef_var_in_catch ()
389+ try
390+ error (" first error" )
391+ catch
392+ __probably_n0t_defined__
393+ end
394+ end
395+ @test length (try
396+ undef_var_in_catch ()
397+ []
398+ catch
399+ catch_stack ()
400+ end ) == 2
You can’t perform that action at this time.
0 commit comments