Fix constant string function assignment (#3945)

This commit is contained in:
Todd Strader
2023-02-08 18:48:07 -05:00
committed by GitHub
parent cf88700fc2
commit d3cbb1e53f
4 changed files with 44 additions and 3 deletions
+2 -2
View File
@@ -2201,8 +2201,8 @@ V3Number& V3Number::opAssignNonXZ(const V3Number& lhs, bool ignoreXZ) {
m_data.m_isNull = true;
} else if (isString()) {
if (VL_UNLIKELY(!lhs.isString())) {
// Non-compatible types, erase value.
m_data.str() = "";
// Numbers can still be strings
m_data.str() = lhs.toString();
} else {
m_data.str() = lhs.m_data.str();
}