Changeset 15035


Ignore:
Timestamp:
06/03/17 04:35:36 (6 years ago)
Author:
Mark Evenson
Message:

Fix byte code verification error in edge case
(Olof-Joachim Frahm)

From <https://github.com/Ferada/abcl/commit/4630bfd27e534bb3e7f0e596cec237c6e5200d6f>.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r15034 r15035  
    68476847
    68486848(defun p2-throw (form target representation)
    6849   ;; FIXME What if we're called with a non-NIL representation?
    6850   (declare (ignore representation))
    68516849  (with-operand-accumulation
    68526850      ((emit-thread-operand)
     
    68586856  ;; Following code will not be reached.
    68596857  (when target
    6860     (emit-push-nil)
     6858    (ecase representation
     6859      ((:int :boolean :char)
     6860       (emit 'iconst_0))
     6861      ((nil)
     6862       (emit-push-nil)))
    68616863    (emit-move-from-stack target)))
    68626864
  • trunk/abcl/test/lisp/abcl/misc-tests.lisp

    r15034 r15035  
    136136    (prog1 T (compile NIL (lambda (list) (nth (lambda ()) list))))
    137137  T)
     138
     139;; these used to fail during byte code verification
     140(deftest throw.representation.1
     141    (prog1 T (compile NIL (lambda () (eql (the fixnum (throw 'foo 42)) 2))))
     142  T)
     143
     144(deftest throw.representation.2
     145    (prog1 T (compile NIL (lambda () (char-code (the character (throw 'foo 42))))))
     146  T)
     147
     148(deftest throw.representation.3
     149    (prog1 T (compile NIL (lambda () (if (the boolean (throw 'foo 42)) 1 2))))
     150  T)
Note: See TracChangeset for help on using the changeset viewer.