restore ecma_string_test.cpp and fix ecma_string.cpp

Signed-off-by: Gongyuhang <517563583@qq.com>
This commit is contained in:
Gongyuhang
2021-10-11 20:14:30 +08:00
parent 58eaf76e05
commit cf2f40cf77
2 changed files with 22 additions and 7 deletions
+1 -1
View File
@@ -415,7 +415,7 @@ uint32_t EcmaString::ComputeHashcode() const
hash = ComputeHashForData(GetDataUtf16(), GetLength());
}
} else {
ASSERT(static_cast<size_t>(GetLength()) > (std::numeric_limits<size_t>::max() >> 1U));
ASSERT(static_cast<size_t>(GetLength()) < std::numeric_limits<size_t>::max() >> 1U);
hash = ComputeHashForData(GetDataUtf16(), GetLength());
}
return hash;