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.
This commit is contained in:
Daniel Kochmański 2020-09-14 23:38:11 +02:00
parent 12df1255a9
commit 9ec064ca23

View file

@ -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 {