|
From: | Bruce Korb |
Subject: | Re: Guile BUG: What's wrong with this? |
Date: | Fri, 06 Jan 2012 15:41:35 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 |
On 01/06/12 15:11, Mark H Weaver wrote:
Bruce Korb<address@hidden> writes:scm_from_locale_stringn() makes an optimization when the length is zero. It returns an immutable string of length zero.Good catch!Two possible fixes: 1. remove the "optimization" 2. check the length in scm_string_upcase_x before choking.I see a third possible fix, which I think I like best: 3. Make scm_nullstr into a mutable string. After all, it can't be changed anyway, and the _only_ reference to it is from scm_from_stringn, so the result should always be mutable. What do other people think? Mark
I think you are presuming that that is the only source of zero length immutable strings. Are you completely certain? Anyway: Running socket.test ERROR: socket.test: AF_INET6/SOCK_STREAM: bind - arguments: ((system-error "bind" "~A" ("Cannot assign requested address") (99))) ERROR: socket.test: AF_INET6/SOCK_STREAM: bind/sockaddr - arguments: ((system-error "bind" "~A" ("Cannot assign requested address") (99))) I'm going to assume that whatever that is, it isn't related to my change. Tho perhaps yours. I am not sure I understand all the ramifications of your change.
[Prev in Thread] | Current Thread | [Next in Thread] |