C Assertion of code builder

Issue #242 resolved
Takashi Kato repo owner created an issue

Getting this when I use (text json schema):

ASSERT failure /home/takashi/projects/sagittarius/src/closure.c:52: SG_CODE_BUILDERP(code)

It seems cache of procedure contained list (but not sure)

NOTE: The actual type of code is SgSharedRef object.

Reproducing code:

(library (lib1)
  (export +closures+)
  (import (rnrs))

(define (foo e)
  (unless (string? e) (assert-violation 'foo "string" e))
  (lambda (v) (string=? v e)))

(define +closures+ `(,foo))
)

;; lib2.scm
(library (lib2)
  (export bar buz)
  (import (rnrs)
          (lib1))

(define (bar s) ((buz) s))
(define (buz) (car +closures+))
)

;; test.scm
(import (rnrs) (lib2))

((bar "s") "s")

Comments (5)

  1. Takashi Kato reporter

    It seems caused by over optimisation. (The procedure contains lifted lambda and that's in the other cache file only).

  2. Log in to comment