1
0
mirror of synced 2026-01-21 02:18:17 +00:00
Jon Burgess 6732e56632 Avoid assert when label is an empty string
Calling back() on an empty string is not allowed and triggers
an assert with recent gcc:

$ cd manual/PRESENTATION_Intro
$ ../../yosys counter.ys
...
/usr/include/c++/8/bits/basic_string.h:1136: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&]: Assertion '!empty()' failed.

802             if (label.back() == ':' && GetSize(label) > 1)
(gdb) p label
$1 = ""
2018-10-28 14:57:04 +00:00
..
2015-09-01 12:40:36 +02:00
2017-02-23 14:21:02 +01:00
2017-05-17 09:08:29 +02:00
2015-07-02 11:14:30 +02:00
2018-10-04 15:36:26 +01:00
2017-04-05 11:25:22 +02:00
2017-12-13 13:27:52 -08:00
2018-07-19 10:22:02 -07:00
2018-07-19 10:22:02 -07:00
2018-10-13 20:34:44 +02:00
2016-02-01 10:10:20 +01:00
2015-07-02 11:14:30 +02:00