From 8d5ea4cdf4ddae97e2c85148167b528ec8dc12ca Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 10 Jun 2012 14:22:22 +0900 Subject: [PATCH] making literals embedded in the source immutable --- eval.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eval.c b/eval.c index 64a1f85e..ecd1a770 100644 --- a/eval.c +++ b/eval.c @@ -928,6 +928,8 @@ static sexp analyze (sexp ctx, sexp object) { } else if (sexp_nullp(x)) { res = sexp_compile_error(ctx, "empty application in source", x); } else { + if (sexp_pointerp(x)) /* accept vectors and other literals directly, */ + sexp_immutablep(x) = 1; /* but they must be immutable */ res = x; } if (sexp_exceptionp(res) && sexp_not(sexp_exception_source(res))