From f34c4f2e26f0e18df7eb3393ec755b5e6c288b00 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Wed, 9 Jul 2025 16:20:27 +0200 Subject: [PATCH] log: deduplicate unescape_id from log_id --- kernel/log.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/kernel/log.cc b/kernel/log.cc index fabbe09fd..679a55562 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -664,15 +664,9 @@ const char *log_const(const RTLIL::Const &value, bool autoint) const char *log_id(const RTLIL::IdString &str) { - log_id_cache.push_back(strdup(str.c_str())); - const char *p = log_id_cache.back(); - if (p[0] != '\\') - return p; - if (p[1] == '$' || p[1] == '\\' || p[1] == 0) - return p; - if (p[1] >= '0' && p[1] <= '9') - return p; - return p+1; + std::string unescaped = RTLIL::unescape_id(str); + log_id_cache.push_back(strdup(unescaped.c_str())); + return log_id_cache.back(); } const char *log_str(const char *str)