chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Only specialize string-length if type is definitely kn


From: Christian Kellermann
Subject: [Chicken-hackers] Only specialize string-length if type is definitely known
Date: Sun, 27 May 2012 20:29:47 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Hackers,

as Mario pointed out the previously commited fix for #855 was only the
sympthom not the cause of the troubles. The real cause has been the
unconditionally specialization of string-length to ##sys#size which
will segfault if given immediate types (since it is only a wrapper for
C_block_size).

So the attached patch removes #:enforce from its types.db entry.

You can test it for yourself with the following example code:

(define (t l)
  (let ((s1 (car l)))
    (zero? (string-length s1))))

(t '(1))

I am not fully sure whether I have understood the purpose of #:enforce
correctly. As I understood it signals the compiler to carry on even if
it does not know for sure which type it is, as the specialization code
will handle type errors by itself. Is that correct? Who can enlighten
me?

Cheers,

Christian

--
9 out of 10 voices in my head say, that I am crazy,
one is humming.

Attachment: 0001-Only-specialize-string-length-if-type-is-definitely-.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]