Open mdbergmann opened 3 years ago
Here's a reduced example. Put this in a file and compile it, and you get a stack overflow.
(in-package :cl-user)
(declaim (inline fn))
(defun fn (x)
(flet ((fn (x) (1+ x)))
(declare (dynamic-extent #'fn))
(fn x)))
(print (fn 1))
If you omit the dynamic-extent
declaration you get a different error:
#<THREAD "interpreter" {246D2EC1}>: Debugger invoked on condition of type ERROR
Caught java.lang.ClassCastException: class org.armedbear.lisp.Cons cannot be cast to class org.armedbear.lisp.LispThread$StackMarker (org.armedbear.lisp.Cons and org.armedbear.lisp.LispThread$StackMarker are in unnamed module of loader 'app').
Previous problems with inline
declarations https://abcl.org/trac/ticket/353. In general, this code could use some rethought.
This came up because cl-murmurhash couldn't be compiled on ABCL.
https://github.com/ruricolist/cl-murmurhash/issues/10
@ruricolist said: "This appears to be an ABCL bug (it's inlining a local function in a global function of the same name that's declared inline). I've pushed up a workaround."