diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-18 10:35:50 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:32 -0500 |
commit | 72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b (patch) | |
tree | ac2c2e7aeb6d8a26ec822644cf74ed8530d8052b /parser/html/nsHtml5AttributeName.cpp | |
parent | 5b862aa38c4fcb1c91797c947ff86b5f70b3ba54 (diff) | |
download | UXP-72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b.tar UXP-72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b.tar.gz UXP-72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b.tar.lz UXP-72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b.tar.xz UXP-72a6fd4d2a7a2242dc4af3a25a7a175995e7fa9b.zip |
Bug 1352082 - Avoid shifting a signed integer left in C++.
Tag UXP Issue #1344
Diffstat (limited to 'parser/html/nsHtml5AttributeName.cpp')
-rw-r--r-- | parser/html/nsHtml5AttributeName.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/parser/html/nsHtml5AttributeName.cpp b/parser/html/nsHtml5AttributeName.cpp index 7e1cb7dd0..f44112f46 100644 --- a/parser/html/nsHtml5AttributeName.cpp +++ b/parser/html/nsHtml5AttributeName.cpp @@ -95,7 +95,7 @@ nsHtml5AttributeName::COLONIFIED_LOCAL(nsIAtom* name, nsIAtom* suffix) return arr; } -nsIAtom** +nsIAtom** nsHtml5AttributeName::SAME_LOCAL(nsIAtom* name) { nsIAtom** arr = new nsIAtom*[4]; @@ -108,7 +108,7 @@ nsHtml5AttributeName::SAME_LOCAL(nsIAtom* name) nsHtml5AttributeName* nsHtml5AttributeName::nameByBuffer(char16_t* buf, int32_t offset, int32_t length, nsHtml5AtomTable* interner) { - int32_t hash = nsHtml5AttributeName::bufToHash(buf, length); + uint32_t hash = nsHtml5AttributeName::bufToHash(buf, length); int32_t index = nsHtml5AttributeName::ATTRIBUTE_HASHES.binarySearch(hash); if (index < 0) { return nsHtml5AttributeName::createAttributeName(nsHtml5Portability::newLocalNameFromBuffer(buf, offset, length, interner)); @@ -122,11 +122,11 @@ nsHtml5AttributeName::nameByBuffer(char16_t* buf, int32_t offset, int32_t length } } -int32_t +uint32_t nsHtml5AttributeName::bufToHash(char16_t* buf, int32_t len) { - int32_t hash2 = 0; - int32_t hash = len; + uint32_t hash2 = 0; + uint32_t hash = len; hash <<= 5; hash += buf[0] - 0x60; int32_t j = len; |