3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-14 21:08:47 +00:00

Merge pull request #680 from jburgess777/fix-empty-string-back-assert

Avoid assert when label is an empty string
This commit is contained in:
Clifford Wolf 2018-10-30 11:25:07 +01:00 committed by GitHub
commit 82965d60f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -799,7 +799,7 @@ static void handle_label(std::string &command, bool &from_to_active, const std::
while (pos < GetSize(command) && command[pos] != ' ' && command[pos] != '\t' && command[pos] != '\r' && command[pos] != '\n')
label += command[pos++];
if (label.back() == ':' && GetSize(label) > 1)
if (GetSize(label) > 1 && label.back() == ':')
{
label = label.substr(0, GetSize(label)-1);
command = command.substr(pos);