liberty: Fix handling of non-ascii characters
Use an `unsigned char` buffer to ensure characters cast to an `int` are in the range 0 <= c <= 255.
This commit is contained in:
@@ -92,7 +92,7 @@ namespace Yosys
|
||||
|
||||
class LibertyInputStream {
|
||||
std::istream &f;
|
||||
std::vector<char> buffer;
|
||||
std::vector<unsigned char> buffer;
|
||||
size_t buf_pos = 0;
|
||||
size_t buf_end = 0;
|
||||
bool eof = false;
|
||||
@@ -107,7 +107,7 @@ namespace Yosys
|
||||
LibertyInputStream(std::istream &f) : f(f) {}
|
||||
|
||||
size_t buffered_size() { return buf_end - buf_pos; }
|
||||
const char *buffered_data() { return buffer.data() + buf_pos; }
|
||||
const unsigned char *buffered_data() { return buffer.data() + buf_pos; }
|
||||
|
||||
int get() {
|
||||
if (buf_pos == buf_end)
|
||||
|
||||
Reference in New Issue
Block a user