mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix inlining of real functions miscasting (#4543).
This commit is contained in:
+6
-2
@@ -58,7 +58,7 @@ class CastVisitor final : public VNVisitor {
|
||||
private:
|
||||
// NODE STATE
|
||||
// Entire netlist:
|
||||
// AstNode::user() // bool. Indicates node is of known size
|
||||
// AstNode::user1() // bool. Indicates node is of known size
|
||||
const VNUser1InUse m_inuser1;
|
||||
|
||||
// STATE
|
||||
@@ -66,12 +66,12 @@ private:
|
||||
// METHODS
|
||||
|
||||
void insertCast(AstNodeExpr* nodep, int needsize) { // We'll insert ABOVE passed node
|
||||
UINFO(4, " NeedCast " << nodep << endl);
|
||||
VNRelinker relinkHandle;
|
||||
nodep->unlinkFrBack(&relinkHandle);
|
||||
//
|
||||
AstCCast* const castp
|
||||
= new AstCCast{nodep->fileline(), nodep, needsize, nodep->widthMin()};
|
||||
UINFO(4, " MadeCast " << static_cast<void*>(castp) << " for " << nodep << endl);
|
||||
relinkHandle.relink(castp);
|
||||
// if (debug() > 8) castp->dumpTree("- castins: ");
|
||||
//
|
||||
@@ -170,6 +170,10 @@ private:
|
||||
ensureLower32Cast(nodep);
|
||||
nodep->user1(1);
|
||||
}
|
||||
void visit(AstExprStmt* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
nodep->user1(1);
|
||||
}
|
||||
void visit(AstNegate* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
nodep->user1(nodep->lhsp()->user1());
|
||||
|
||||
Reference in New Issue
Block a user