Internals: Fix coredump when dump with bad null enum itemp()

This commit is contained in:
Wilson Snyder 2025-12-03 21:35:59 -05:00
parent 7957701db8
commit 4426aff3d3
1 changed files with 1 additions and 1 deletions

View File

@ -1297,7 +1297,7 @@ public:
ASTGEN_MEMBERS_AstEnumItemRef;
void dump(std::ostream& str) const override;
void dumpJson(std::ostream& str) const override;
string name() const override VL_MT_STABLE { return itemp()->name(); }
string name() const override VL_MT_STABLE { return itemp() ? itemp()->name() : "<null>"; }
int instrCount() const override { return 0; }
bool sameNode(const AstNode* samep) const override {
const AstEnumItemRef* const sp = VN_DBG_AS(samep, EnumItemRef);