summaryrefslogtreecommitdiff
path: root/parser/html/nsHtml5ElementName.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-18 10:35:50 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:32 -0500
commit72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b (patch)
treeac2c2e7aeb6d8a26ec822644cf74ed8530d8052b /parser/html/nsHtml5ElementName.cpp
parent5b862aa38c4fcb1c91797c947ff86b5f70b3ba54 (diff)
downloaduxp-72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b.tar.gz
Bug 1352082 - Avoid shifting a signed integer left in C++.
Tag UXP Issue #1344
Diffstat (limited to 'parser/html/nsHtml5ElementName.cpp')
-rw-r--r--parser/html/nsHtml5ElementName.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/parser/html/nsHtml5ElementName.cpp b/parser/html/nsHtml5ElementName.cpp
index f997f47813..faed0c082a 100644
--- a/parser/html/nsHtml5ElementName.cpp
+++ b/parser/html/nsHtml5ElementName.cpp
@@ -73,7 +73,7 @@ nsHtml5ElementName::isCustom()
nsHtml5ElementName*
nsHtml5ElementName::elementNameByBuffer(char16_t* buf, int32_t offset, int32_t length, nsHtml5AtomTable* interner)
{
- int32_t hash = nsHtml5ElementName::bufToHash(buf, length);
+ uint32_t hash = nsHtml5ElementName::bufToHash(buf, length);
int32_t index = nsHtml5ElementName::ELEMENT_HASHES.binarySearch(hash);
if (index < 0) {
return new nsHtml5ReleasableElementName(nsHtml5Portability::newLocalNameFromBuffer(buf, offset, length, interner));
@@ -87,10 +87,10 @@ nsHtml5ElementName::elementNameByBuffer(char16_t* buf, int32_t offset, int32_t l
}
}
-int32_t
+uint32_t
nsHtml5ElementName::bufToHash(char16_t* buf, int32_t len)
{
- int32_t hash = len;
+ uint32_t hash = len;
hash <<= 5;
hash += buf[0] - 0x60;
int32_t j = len;