Use ARGS_LENGTH_MAX as upper bound in MArgumentsLength::computeRange.

This commit is contained in:
Pale Moon
2017-11-21 19:44:25 +01:00
committed by Roy Tam
parent 9c9841e5f0
commit 421fd434f3
+4 -3
View File
@@ -15,6 +15,7 @@
#include "jit/MIRGenerator.h"
#include "jit/MIRGraph.h"
#include "js/Conversions.h"
#include "vm/ArgumentsObject.h"
#include "vm/TypedArrayCommon.h"
#include "jsopcodeinlines.h"
@@ -1717,9 +1718,9 @@ MArgumentsLength::computeRange(TempAllocator& alloc)
{
// This is is a conservative upper bound on what |TooManyActualArguments|
// checks. If exceeded, Ion will not be entered in the first place.
MOZ_ASSERT(js_JitOptions.maxStackArgs <= UINT32_MAX,
"NewUInt32Range requires a uint32 value");
setRange(Range::NewUInt32Range(alloc, 0, js_JitOptions.maxStackArgs));
static_assert(ARGS_LENGTH_MAX <= UINT32_MAX,
"NewUInt32Range requires a uint32 value");
setRange(Range::NewUInt32Range(alloc, 0, ARGS_LENGTH_MAX));
}
void