Commit 281c896e authored by Erick's avatar Erick

Fix in the compiler (could loop on circular structures)

Compiling (cons #0=(a . #0#) #1=(a . #1#)) lead to an infinite loop
since it searches in contants using the member function . Using memq
solves the problem, at the expense of a little bigger tables.

Using (member x y equiv?) is not a good idea (until it is optimized)
since each bootstrap phase is more than 10 times slower.
parent 1098de2b
......@@ -21,7 +21,7 @@
;;;; Author: Erick Gallesio []
;;;; Creation date: 26-Feb-2000 10:47 (eg)
;;;; Last file update: 5-Oct-2018 18:09 (eg)
;;;; Last file update: 27-Nov-2018 14:34 (eg)
(define-module STKLOS-COMPILER
......@@ -128,7 +128,7 @@
; ======================================================================
(define (fetch-constant c)
(let ((x (member c *code-constants*)))
(let ((x (memq c *code-constants*)))
(unless x
;; This constant was not in the table; add it.
(set! x (list c))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment