From 9ec064ca23140eeca8eba75aea2ab26b2b83acd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 14 Sep 2020 23:38:11 +0200 Subject: [PATCH] ecl_symbol_value: detect early symbol access during compilation This test is executed only when ECL itself is compiled. It is to ensure early notice of issues similar to #604. --- src/c/symbol.d | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/c/symbol.d b/src/c/symbol.d index ebd79e21..0edd081d 100644 --- a/src/c/symbol.d +++ b/src/c/symbol.d @@ -137,6 +137,13 @@ ecl_make_symbol(const char *s, const char *p) cl_object ecl_symbol_value(cl_object s) { +#ifndef ECL_FINAL + /* Symbols are not initialized yet. This test is issued only during ECL + compilation to ensure, that we have no early references in the core. */ + if(cl_num_symbols_in_core < 3) { + ecl_internal_error("SYMBOL-VALUE: symbols are not initialized yet."); + } +#endif if (Null(s)) { return s; } else {