Make 'string-append' more efficient and robust.
authorMark H Weaver <mhw@netris.org>
Mon, 1 Apr 2013 07:37:36 +0000 (03:37 -0400)
committerMark H Weaver <mhw@netris.org>
Mon, 1 Apr 2013 07:47:09 +0000 (03:47 -0400)
commit2f13a46672a347be0f7bb1b360a213f6d6ce0288
tree981d6308378b0287aa48fc7e9b26189d046c2093
parent3b80c3585221a899c9a6b87e742d267655bb0abc
Make 'string-append' more efficient and robust.

* libguile/strings.c (scm_string_append): Check for numerical overflow
  while computing the length of the result.  Double-check that we don't
  overflow the result string, and that it is the correct length in the
  end (in case another thread changed the list).  When copying a narrow
  string to a wide result, avoid calling 'scm_i_string_length' and
  'scm_i_string_chars' on each character.
libguile/strings.c