aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-10-30 11:25:07 +0100
committerGitHub <noreply@github.com>2018-10-30 11:25:07 +0100
commit82965d60f53c817fea303abf8d6887ced8c8420e (patch)
tree20b999fa4b614f5c72defc8420e53ac96acb3e62
parentdb676957a0c3032ff44e3195d770948c1c3660af (diff)
parent6732e566321b828c83b563d24a10ac31c6d03e28 (diff)
downloadyosys-82965d60f53c817fea303abf8d6887ced8c8420e.tar.gz
yosys-82965d60f53c817fea303abf8d6887ced8c8420e.tar.bz2
yosys-82965d60f53c817fea303abf8d6887ced8c8420e.zip
Merge pull request #680 from jburgess777/fix-empty-string-back-assert
Avoid assert when label is an empty string
-rw-r--r--kernel/yosys.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index 21eeadaaf..f002955ad 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -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);