out-of-extent return not checked in safe code

Bug #308918 reported by Nikodemus Siivola on 2008-12-17
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
High
Unassigned

Bug Description

BUGS #422

 (declaim (optimize safety))
 (funcall (catch 't (block nil (throw 't (lambda () (return))))))

behaves ...erratically. Reported by Kevin Reid on sbcl-devel
2007-07-06. (We don't _have_ to check things like this, but we
generally try to check returns in safe code, so we should here too.)

This comment from ir2tran.lisp seem pertinent:

;;; Convert a non-local lexical exit. First find the NLX-INFO in our
;;; environment. Note that this is never called on the escape exits
;;; for CATCH and UNWIND-PROTECT, since the escape functions aren't
;;; IR2 converted.
(defun ir2-convert-exit (node block)
  (declare (type exit node) (type ir2-block block))
  (let* ((nlx (exit-nlx-info node))
         (loc (find-in-physenv nlx (node-physenv node)))
         (temp (make-stack-pointer-tn))
         (value (exit-value node)))
    (if (nlx-info-safe-p nlx)
        (vop value-cell-ref node block loc temp)
        (emit-move node block loc temp))
    (if value
        (let ((locs (ir2-lvar-locs (lvar-info value))))
          (vop unwind node block temp (first locs) (second locs)))
        (let ((0-tn (emit-constant 0)))
          (vop unwind node block temp 0-tn 0-tn))))
  (values))

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  status confirmed

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: http://getfiregpg.org

iEYEARECAAYFAklI5T0ACgkQbSpkIAKPfsVA0ACgnt2KIV87NFZAYlI83oFRDBUJ
/WwAn09b2+DBW/fZ/6TkPLi2pgfs9VOJ
=3nyL
-----END PGP SIGNATURE-----

Changed in sbcl:
status: New → Confirmed
Changed in sbcl:
importance: Undecided → Medium
Changed in sbcl:
importance: Medium → High
description: updated
Changed in sbcl:
assignee: nobody → rosa maria (rprosamaria383)
dobey (dobey) on 2014-03-28
Changed in sbcl:
assignee: rosa maria (rprosamaria383) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers