From 1e76e39b9a9cf50bdfb3545541b8ecfa03d87a6e Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 16 May 2016 22:56:51 +0900 Subject: [PATCH] don't allow redefining reader labels Fixes issue #337. --- lib/srfi/38.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/srfi/38.scm b/lib/srfi/38.scm index 9e8069b7..b8e79fa7 100644 --- a/lib/srfi/38.scm +++ b/lib/srfi/38.scm @@ -320,7 +320,10 @@ ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (let* ((str (read-label '())) (n (string->number str))) - (if (not n) (read-error "read error: invalid reference" str)) + (if (not n) + (read-error "read error: invalid reference" str)) + (if (assv n shared) + (read-error "read error: duplicate label" str)) (cond ((eqv? #\= (peek-char in)) (read-char in)