From 97ad0623dfd772e8bea0728b439a8cd1f7493b7d Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 2 Aug 2014 13:34:07 +0200 Subject: Fixed memory corruption related to id2cstr() --- kernel/rtlil.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 70e01b72..daf888b7 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -121,7 +121,7 @@ namespace RTLIL return str; } - static inline const char *id2cstr(std::string str) { + static inline const char *id2cstr(const std::string &str) { if (str.size() > 1 && str[0] == '\\' && str[1] != '$') return str.c_str() + 1; return str.c_str(); @@ -131,7 +131,7 @@ namespace RTLIL return unescape_id(str.str()); } - static inline const char *id2cstr(RTLIL::IdString str) { + static inline const char *id2cstr(const RTLIL::IdString &str) { return id2cstr(str.str()); } -- cgit v1.2.3