File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,9 @@ int LibertyInputStream::peek_cold(size_t offset)
123123 if (!extend_buffer_at_least (offset + 1 ))
124124 return EOF;
125125 }
126-
126+ #ifdef log_assert
127+ log_assert (buf_pos + offset < buffer.size ());
128+ #endif
127129 return buffer[buf_pos + offset];
128130}
129131
@@ -458,7 +460,6 @@ int LibertyParser::lexer_inner(std::string &str)
458460 // if it wasn't an identifer, number of array range,
459461 // maybe it's a string?
460462 if (c == ' "' ) {
461- f.consume (1 );
462463 size_t i = 0 ;
463464 while (true ) {
464465 c = f.peek (i);
@@ -469,14 +470,13 @@ int LibertyParser::lexer_inner(std::string &str)
469470 break ;
470471 }
471472 str.clear ();
472- f.unget ();
473- str.append (f.buffered_data (), f.buffered_data () + i + 1 );
473+ str.append (f.buffered_data (), f.buffered_data () + i);
474474 // Usage in filterlib is expected to retain quotes
475475 // but yosys expects to get unquoted
476476#ifdef FILTERLIB
477477 str = " \" " + str + " \" " ;
478478#endif
479- f.consume (i + 2 );
479+ f.consume (i + 1 );
480480 return ' v' ;
481481 }
482482
You can’t perform that action at this time.
0 commit comments