summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-02 13:34:07 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-02 13:34:07 +0200
commit97ad0623dfd772e8bea0728b439a8cd1f7493b7d (patch)
tree74de21da77d320d9d5cf04276905db79a60fa44a /kernel
parentb9bd22b8c8d46284fba4d4c1cbd09092a9ccc5c3 (diff)
Fixed memory corruption related to id2cstr()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.h4
1 files 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());
}