Replace assert in get_reference with more useful error message

This commit is contained in:
Lofty 2021-03-17 02:43:25 +00:00 committed by Marcelina Kościelnicka
parent 4f187d53c5
commit 937392ad33
1 changed files with 2 additions and 1 deletions

View File

@ -166,7 +166,8 @@ namespace RTLIL
log_assert(p[0] == '$' || p[0] == '\\'); log_assert(p[0] == '$' || p[0] == '\\');
log_assert(p[1] != 0); log_assert(p[1] != 0);
for (const char *c = p; *c; c++) for (const char *c = p; *c; c++)
log_assert((unsigned)*c > (unsigned)' '); if ((unsigned)*c <= (unsigned)' ')
log_error("Found control character or space (0x%02hhx) in string '%s' which is not allowed in RTLIL identifiers\n", *c, p);
#ifndef YOSYS_NO_IDS_REFCNT #ifndef YOSYS_NO_IDS_REFCNT
if (global_free_idx_list_.empty()) { if (global_free_idx_list_.empty()) {