chicken-janitors
[Top][All Lists]
Advanced

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

[Chicken-janitors] #1215: Warn about too specific type declarations


From: Chicken Trac
Subject: [Chicken-janitors] #1215: Warn about too specific type declarations
Date: Tue, 25 Aug 2015 19:57:46 -0000

#1215: Warn about too specific type declarations
-------------------------+---------------------
 Reporter:  syn          |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  minor        |  Milestone:  someday
Component:  scrutinizer  |    Version:  4.10.x
 Keywords:               |
-------------------------+---------------------
 The following program produces code that may segfault when compiled with
 specialization:

 {{{
 (: foo (-> string))

 (define (foo) (read))

 (print (string-ref (foo) 0))
 }}}
 {{{
 $ csc -specialize foo.scm
 echo '"foo"' | ./foo
 f

 $ echo 123 | ./foo

 Error: segmentation violation

         Call history:

         baz.scm:5: foo
         baz.scm:3: read         <--
 }}}

 I think the root cause is that the declared return type of {{{foo}}} is
 more specific than that of {{{read}}}. Perhaps this could be detected by
 the scrutinizer and warned about accordingly.

--
Ticket URL: <http://bugs.call-cc.org/ticket/1215>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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