diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-08-02 13:34:07 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-08-02 13:34:07 +0200 |
commit | 97ad0623dfd772e8bea0728b439a8cd1f7493b7d (patch) | |
tree | 74de21da77d320d9d5cf04276905db79a60fa44a | |
parent | b9bd22b8c8d46284fba4d4c1cbd09092a9ccc5c3 (diff) | |
download | yosys-97ad0623dfd772e8bea0728b439a8cd1f7493b7d.tar.gz yosys-97ad0623dfd772e8bea0728b439a8cd1f7493b7d.tar.bz2 yosys-97ad0623dfd772e8bea0728b439a8cd1f7493b7d.zip |
Fixed memory corruption related to id2cstr()
-rw-r--r-- | kernel/rtlil.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 70e01b721..daf888b79 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()); } |