[Top][All Lists]

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

[Chicken-users] [patch] write-string fails to check type of its params

From: Alejandro Forero Cuervo
Subject: [Chicken-users] [patch] write-string fails to check type of its params
Date: Mon, 17 May 2004 17:30:02 -0500
User-agent: Mutt/

The following (broken) code, when compiled, gives a strange error:

> (declare (uses extras))
> (write-string "hey" (open-output-file "/tmp/foo"))

I get:

> Error: (make-string) size is negative: -536889320

Evidently, make-string is failing to  check that its optional NUM
parameter is a fixnum.

Enclosed is  a patch to have  it perform the check  (made against
1.45, but excluding  the changes in extras.c from  it; that means
extras.c needs  to be  regenerated after  the patch  is applied).
With the patch, the above code gives:

> Error: (write-string) bad argument type - not a fixnum: #<output port 
> /tmp/foo>

Took me a while to figure out what was going on. :)



---=(  Comunidad de Usuarios de Software Libre en Colombia  )=---               
---=( )=--=( address@hidden  )=---                   

Attachment: patch
Description: Text document

Attachment: signature.asc
Description: Digital signature

reply via email to

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