зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1606568 - Prevent excessive instantiation of BigInt parsing template. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D82479
This commit is contained in:
Родитель
e41d11e5f3
Коммит
3a69560ad3
|
@ -92,6 +92,7 @@
|
|||
#include <limits>
|
||||
#include <math.h>
|
||||
#include <memory>
|
||||
#include <type_traits> // std::is_same_v
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "jsnum.h"
|
||||
|
@ -1554,6 +1555,11 @@ BigInt* BigInt::parseLiteralDigits(JSContext* cx,
|
|||
const Range<const CharT> chars,
|
||||
unsigned radix, bool isNegative,
|
||||
bool* haveParseError, gc::InitialHeap heap) {
|
||||
static_assert(
|
||||
std::is_same_v<CharT, JS::Latin1Char> || std::is_same_v<CharT, char16_t>,
|
||||
"only the bare minimum character types are supported, to avoid "
|
||||
"excessively instantiating this template");
|
||||
|
||||
MOZ_ASSERT(chars.length());
|
||||
|
||||
RangedPtr<const CharT> start = chars.begin();
|
||||
|
|
Загрузка…
Ссылка в новой задаче