summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-05-11 07:37:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-05-11 07:37:28 -0700
commitfd3f41e01856e41bb6e35b139066b2e96d01f7a3 (patch)
tree54069f4f96957d741af777341895f9cfbaad9bee
parent56d5ae7c0e8891355452cd29f3b0dede934c7d82 (diff)
downloadtxr-fd3f41e01856e41bb6e35b139066b2e96d01f7a3.tar.gz
txr-fd3f41e01856e41bb6e35b139066b2e96d01f7a3.tar.bz2
txr-fd3f41e01856e41bb6e35b139066b2e96d01f7a3.zip
* lib.c (chr_str_set): Check for literal strings.
-rw-r--r--ChangeLog4
-rw-r--r--lib.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9bfabebe..c778a0e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2015-05-11 Kaz Kylheku <kaz@kylheku.com>
+ * lib.c (chr_str_set): Check for literal strings.
+
+2015-05-11 Kaz Kylheku <kaz@kylheku.com>
+
Fix argument count checking regression.
* eval.c (apply): Revert some changes from 2015-03-13
diff --git a/lib.c b/lib.c
index ad83e91a..46e445ca 100644
--- a/lib.c
+++ b/lib.c
@@ -3463,6 +3463,11 @@ val chr_str_set(val str, val ind, val chr)
{
cnum index = c_num(ind);
+ if (is_lit(str)) {
+ uw_throwf(error_s, lit("chr-str-set: cannot modify literal string ~s"),
+ str, nao);
+ }
+
if (index < 0) {
ind = plus(length_str(str), ind);
index = c_num(ind);