From: Catherine Date: Tue, 14 Dec 2021 16:27:37 +0000 (+0000) Subject: Fix null pointer dereference after failing to extract DFF from memory. X-Git-Tag: yosys-0.13~24^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=48ed6d998bb2943891acd730c4aaef5d1deecb7e;p=yosys.git Fix null pointer dereference after failing to extract DFF from memory. Fixes #3110. --- diff --git a/kernel/mem.cc b/kernel/mem.cc index 746f667ea..96168ff76 100644 --- a/kernel/mem.cc +++ b/kernel/mem.cc @@ -985,7 +985,8 @@ Cell *Mem::extract_rdff(int idx, FfInitVals *initvals) { c = ff.emit(); } - log("Extracted %s FF from read port %d of %s.%s: %s\n", trans_use_addr ? "addr" : "data", + if (c) + log("Extracted %s FF from read port %d of %s.%s: %s\n", trans_use_addr ? "addr" : "data", idx, log_id(module), log_id(memid), log_id(c)); port.en = State::S1;