From 6d0f39d841c1b203b21da8c99d7da54c32bb940a Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 11 May 2012 18:26:45 -0400 Subject: [PATCH] Fix sign-extension underneath boolean operators. (In theory shouldn't matter, since comparing to zero.) --- src/V3Width.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/V3Width.cpp b/src/V3Width.cpp index fdfe17d08..ad7b26ae5 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -1770,17 +1770,19 @@ private: UINFO(4," _new: "<castConst(); if (constp) { V3Number num (nodep->fileline(), expWidth); num.opRedOr(constp->num()); - num.isSigned(constp->isSigned()); + num.isSigned(expSigned); AstNode* newp = new AstConst(nodep->fileline(), num); constp->replaceWith(newp); nodep=newp; @@ -1791,7 +1793,7 @@ private: linker.relink(newp); nodep=newp; } - nodep->dtypeChgWidth(expWidth,expWidth); + nodep->dtypeChgWidthSigned(expWidth,expWidth,expSigned); UINFO(4," _new: "<widthMin()):"") <<" bits."); } - fixWidthReduce(underp, expWidth); underp=NULL;//Changed + fixWidthReduce(underp); underp=NULL;//Changed } }