From 13cf9ba0750773caebf8d32d38dcdb92d7e58920 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sat, 21 Mar 2026 10:15:18 +0000 Subject: [PATCH] Internals: Type check vertices made in DfgPeephole --- src/V3DfgPeephole.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/V3DfgPeephole.cpp b/src/V3DfgPeephole.cpp index a392d9547..993050db0 100644 --- a/src/V3DfgPeephole.cpp +++ b/src/V3DfgPeephole.cpp @@ -233,6 +233,9 @@ class V3DfgPeephole final : public DfgVisitor { Vertex* make(FileLine* flp, const DfgDataType& dtype, Operands... operands) { // Find or create an equivalent vertex Vertex* const vtxp = m_cache.getOrCreate(flp, dtype, operands...); + // Sanity check + UASSERT_OBJ(vtxp->dtype() == dtype, vtxp, "Vertex dtype mismatch"); + if (VL_UNLIKELY(v3Global.opt.debugCheck())) vtxp->typeCheck(m_dfg); // Add to work list addToWorkList(vtxp); // Return new node