From 4b8200eb4943dcbdb2bede8695ca77cd7d6fde3a Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 22 Sep 2015 08:13:09 +0200 Subject: [PATCH] Fixed segfault on invalid verilog constant 1'b_ --- frontends/verilog/const2ast.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontends/verilog/const2ast.cc b/frontends/verilog/const2ast.cc index 9cc99750f..4a58357bf 100644 --- a/frontends/verilog/const2ast.cc +++ b/frontends/verilog/const2ast.cc @@ -122,7 +122,7 @@ static void my_strtobin(std::vector &data, const char *str, int le } int len = GetSize(data); - RTLIL::State msb = data.back(); + RTLIL::State msb = data.empty() ? RTLIL::S0 : data.back(); if (len_in_bits < 0) { if (len < 32) -- 2.30.2