out-of-extent return not checked in safe code

Bug #308918 reported by Nikodemus Siivola
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Medium
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))

Tags: compiler-ir2
Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: [Bug 308918] [NEW] out-of-extent return not checked in safe code

-----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)
Changed in sbcl:
assignee: rosa maria (rprosamaria383) → nobody
Revision history for this message
Attila Lendvai (attila-lendvai) wrote :
Revision history for this message
Stas Boukarev (stassats) wrote :

Downgrading the priority because it can be as high priority as it wants to be but it's not getting fixed any time soon, after sitting here for more than eleven years.

Changed in sbcl:
importance: High → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.