From 6fb6c7790f9910b3fae0a09bb6f4ede2b4ed1dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 11 Dec 2023 14:06:58 +0100 Subject: [PATCH] cmp: variable holding function has gensym as a name Previously we've named the function's variable with the function name. That could lead to a varible named (SETF FOO), and that can break down the road because variable names are assumed to be symbols. Moreover this change will prevent a possible fail scenario where we inline a constant value with a known name instead of the function with the same name. --- src/cmp/cmppass1-fun.lsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmp/cmppass1-fun.lsp b/src/cmp/cmppass1-fun.lsp index efc1ce341..bdefe74a1 100644 --- a/src/cmp/cmppass1-fun.lsp +++ b/src/cmp/cmppass1-fun.lsp @@ -38,7 +38,7 @@ "~s: The function ~s was already defined." origin (car def)) (push (car def) fnames) (let* ((name (car def)) - (var (make-var :name name :kind :object)) + (var (make-var :name (gensym) :kind :object)) (fun (make-fun :name name :var var))) (cmp-env-register-function fun new-env) (push (cons fun (cdr def)) defs)))