Fix warning with attribute string lookup

(cherry picked from commit b639f1426f)
This commit is contained in:
Tim Wojtulewicz 2024-01-03 14:35:41 -07:00
parent 9ae61eab0c
commit c0f12b5cd0

View file

@ -43,7 +43,10 @@ const char* attr_name(AttrTag t)
"&ordered", "&ordered",
}; };
return attr_names[int(t)]; if ( int(t) >= 0 && int(t) < NUM_ATTRS )
return attr_names[int(t)];
else
return "<unknown>";
} }
Attr::Attr(AttrTag t, ExprPtr e) : expr(std::move(e)) Attr::Attr(AttrTag t, ExprPtr e) : expr(std::move(e))