From: Eddie Hung Date: Wed, 22 May 2019 00:20:19 +0000 (-0700) Subject: Try again X-Git-Tag: yosys-0.9~117^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5a29460b9328fe86739039b05daaf70355502fa;p=yosys.git Try again --- diff --git a/frontends/aiger/aigerparse.cc b/frontends/aiger/aigerparse.cc index 566825ece..e5ec475d1 100644 --- a/frontends/aiger/aigerparse.cc +++ b/frontends/aiger/aigerparse.cc @@ -55,10 +55,16 @@ void AigerReader::parse_aiger() // Optional values B = C = J = F = 0; - if (f.peek() == ' ') { - if (!(f >> B >> C >> J >> F)) - log_error("Invalid AIGER header\n"); - } + if (f.peek() != ' ') goto parse_body; + if (!(f >> B)) log_error("Invalid AIGER header\n"); + if (f.peek() != ' ') goto parse_body; + if (!(f >> C)) log_error("Invalid AIGER header\n"); + if (f.peek() != ' ') goto parse_body; + if (!(f >> J)) log_error("Invalid AIGER header\n"); + if (f.peek() != ' ') goto parse_body; + if (!(f >> F)) log_error("Invalid AIGER header\n"); + +parse_body: std::string line; std::getline(f, line); // Ignore up to start of next line, as standard