From 48ed6d998bb2943891acd730c4aaef5d1deecb7e Mon Sep 17 00:00:00 2001 From: Catherine Date: Tue, 14 Dec 2021 16:27:37 +0000 Subject: [PATCH] Fix null pointer dereference after failing to extract DFF from memory. Fixes #3110. --- kernel/mem.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.30.2