[trivial-backtrace-devel] Problem with test on some compilers...

Patrick Stein pat at nklein.com
Wed May 16 03:34:26 UTC 2012


The trivial-backtrace-test package defines a GENERATES-BACKTRACE lift test.  That test attempts to create a DIVISION-BY-ZERO error.  However, SBCL notices that the return value of the division is not used and deletes the division.  Stopping it from doing so only requires a '(declare (optimize (safety 3)))'.  This will allow the test to succeed even under SBCL.

Below is a patch to the current quicklisp version of TRIVIAL-BACKTRACE.

Thanks,
Patrick

diff -c old/tests.lisp new/tests.lisp
*** old/tests.lisp      2012-05-15 22:28:36.000000000 -0500
--- new/tests.lisp      2012-05-15 22:27:46.000000000 -0500
***************
*** 9,14 ****
--- 9,15 ----
      (handler-case 
        (let ((x 1))
          (let ((y (- x (expt 1024 0))))
+             (declare (optimize (safety 3)))
            (/ 2 y)))
        (error (c)
        (setf output (print-backtrace c :output nil))))





More information about the trivial-backtrace-devel mailing list