diff options
author | clairexen <claire@symbioticeda.com> | 2020-05-29 16:31:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-29 16:31:44 +0200 |
commit | af36afe722dc35b129351af592ef340e512e0292 (patch) | |
tree | c2bd330880c5e443d69ac51fb4a2e45eebeb4016 /kernel | |
parent | 5874a14d659068acbf04aa381a782ea8c0a5adce (diff) | |
parent | efa7424fb93943d746a344d08e5e879d983709e9 (diff) | |
download | yosys-af36afe722dc35b129351af592ef340e512e0292.tar.gz yosys-af36afe722dc35b129351af592ef340e512e0292.tar.bz2 yosys-af36afe722dc35b129351af592ef340e512e0292.zip |
Merge pull request #2092 from whitequark/rtlil-no-space-control
Restrict RTLIL::IdString to not contain whitespace or control chars
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rtlil.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 423c0b4bd..91d6a9f77 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -150,9 +150,6 @@ namespace RTLIL if (!p[0]) return 0; - log_assert(p[0] == '$' || p[0] == '\\'); - log_assert(p[1] != 0); - auto it = global_id_index_.find((char*)p); if (it != global_id_index_.end()) { #ifndef YOSYS_NO_IDS_REFCNT @@ -165,6 +162,11 @@ namespace RTLIL return it->second; } + log_assert(p[0] == '$' || p[0] == '\\'); + log_assert(p[1] != 0); + for (const char *c = p; *c; c++) + log_assert((unsigned)*c > (unsigned)' '); + #ifndef YOSYS_NO_IDS_REFCNT if (global_free_idx_list_.empty()) { if (global_id_storage_.empty()) { |