Skip to content

Commit f060c2f

Browse files
committed
irep serialisation: do not use string hash
We want string numbering, not string hashing. For `dstringt` these are interchangeable, but that's not the case for `std::string`.
1 parent 2b6a337 commit f060c2f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: src/util/irep_serialization.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ Date: May 2007
1313

1414
#include "irep_serialization.h"
1515

16+
#include "exception_utils.h"
17+
#include "string_container.h"
18+
1619
#include <climits>
1720
#include <iostream>
1821

19-
#include "exception_utils.h"
20-
2122
void irep_serializationt::write_irep(
2223
std::ostream &out,
2324
const irept &irep)
@@ -211,7 +212,11 @@ void irep_serializationt::write_string_ref(
211212
std::ostream &out,
212213
const irep_idt &s)
213214
{
214-
size_t id=irep_id_hash()(s);
215+
#ifdef USE_DSTRING
216+
size_t id = s.get_no();
217+
#else
218+
size_t id = get_string_container()[s];
219+
#endif
215220
if(id>=ireps_container.string_map.size())
216221
ireps_container.string_map.resize(id+1, false);
217222

0 commit comments

Comments
 (0)