From 190d4b0d93599e5b58e773dc6375054c3a6e3dbf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 20 Mar 2011 23:34:42 +0100 Subject: 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. --- libguile/vm-i-loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libguile/vm-i-loader.c') diff --git a/libguile/vm-i-loader.c b/libguile/vm-i-loader.c index fae39fb8d..0d8678485 100644 --- a/libguile/vm-i-loader.c +++ b/libguile/vm-i-loader.c @@ -40,7 +40,7 @@ VM_DEFINE_LOADER (102, load_string, "load-string") FETCH_LENGTH (len); SYNC_REGISTER (); - PUSH (scm_i_make_string (len, &buf)); + PUSH (scm_i_make_string (len, &buf, 1)); memcpy (buf, (char *) ip, len); ip += len; NEXT; @@ -113,7 +113,7 @@ VM_DEFINE_LOADER (107, load_wide_string, "load-wide-string") } SYNC_REGISTER (); - PUSH (scm_i_make_wide_string (len / 4, &wbuf)); + PUSH (scm_i_make_wide_string (len / 4, &wbuf, 1)); memcpy ((char *) wbuf, (char *) ip, len); ip += len; NEXT; -- cgit v1.2.3