mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 02:00:26 +02:00
Make VM string literals immutable.
* libguile/strings.c (scm_i_make_string, scm_i_make_wide_string): Add `read_only_p' parameter. All callers updated. * libguile/vm-i-loader.c (load_string, load_wide_string): Push read-only strings. * test-suite/tests/strings.test ("literals"): New test prefix.
This commit is contained in:
parent
95c1cfb550
commit
190d4b0d93
13 changed files with 83 additions and 56 deletions
|
@ -1515,9 +1515,9 @@ SCM_DEFINE (scm_char_set_to_string, "char-set->string", 1, 0, 0,
|
|||
|
||||
count = scm_to_int (scm_char_set_size (cs));
|
||||
if (wide)
|
||||
result = scm_i_make_wide_string (count, &wbuf);
|
||||
result = scm_i_make_wide_string (count, &wbuf, 0);
|
||||
else
|
||||
result = scm_i_make_string (count, &buf);
|
||||
result = scm_i_make_string (count, &buf, 0);
|
||||
|
||||
for (k = 0; k < cs_data->len; k++)
|
||||
for (n = cs_data->ranges[k].lo; n <= cs_data->ranges[k].hi; n++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue