From 089fe9ae0f7152c3de67117f03852a6d7acbbe55 Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Fri, 27 Mar 2020 13:22:16 -0400 Subject: [PATCH] Check signedness --- src/V3Width.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 2a293de16..2a8e47331 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -3591,7 +3591,9 @@ private: AstNodeDType* typeLhsp = refLhsp->refDTypep(); AstNodeDType* typeRhsp = refRhsp->refDTypep(); if (AstBasicDType* basicLhsp = VN_CAST(typeLhsp, BasicDType)) { - if (VN_IS(typeRhsp, BasicDType) && basicLhsp->same(typeRhsp)) { + AstBasicDType* basicRhsp = VN_CAST(typeRhsp, BasicDType); + if (basicRhsp && basicLhsp->same(typeRhsp) + && basicLhsp->isSigned() == basicRhsp->isSigned()) { equal = true; } } else if (refLhsp->dtypep() == refRhsp->dtypep()) {