From e9c6094a9fd86fe7da67e7847423723fa408fbf5 Mon Sep 17 00:00:00 2001 From: Bogdan Postelnicu Date: Mon, 8 Feb 2016 13:51:47 +0200 Subject: [PATCH] Bug 1239269 - as lastIndex cannot be negative change it's storage class from int32_t to uint32_t, r=Waldo --- js/src/builtin/RegExp.cpp | 4 ++-- js/src/builtin/RegExp.h | 4 ++-- js/src/jit/CodeGenerator.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index eba0214656a..c9003e10968 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -928,7 +928,7 @@ js::RegExpMatcher(JSContext* cx, unsigned argc, Value* vp) * This code cannot re-enter Ion code. */ bool js::RegExpMatcherRaw(JSContext* cx, HandleObject regexp, HandleString input, - int32_t lastIndex, bool sticky, + uint32_t lastIndex, bool sticky, MatchPairs* maybeMatches, MutableHandleValue output) { MOZ_ASSERT(lastIndex <= INT32_MAX); @@ -998,7 +998,7 @@ js::RegExpTester(JSContext* cx, unsigned argc, Value* vp) * This code cannot re-enter Ion code. */ bool js::RegExpTesterRaw(JSContext* cx, HandleObject regexp, HandleString input, - int32_t lastIndex, bool sticky, int32_t* endIndex) + uint32_t lastIndex, bool sticky, int32_t* endIndex) { MOZ_ASSERT(lastIndex <= INT32_MAX); diff --git a/js/src/builtin/RegExp.h b/js/src/builtin/RegExp.h index ee3a2555b28..49885feb4d6 100644 --- a/js/src/builtin/RegExp.h +++ b/js/src/builtin/RegExp.h @@ -48,7 +48,7 @@ RegExpMatcher(JSContext* cx, unsigned argc, Value* vp); extern bool RegExpMatcherRaw(JSContext* cx, HandleObject regexp, HandleString input, - int32_t lastIndex, bool sticky, + uint32_t lastIndex, bool sticky, MatchPairs* maybeMatches, MutableHandleValue output); extern bool @@ -56,7 +56,7 @@ RegExpTester(JSContext* cx, unsigned argc, Value* vp); extern bool RegExpTesterRaw(JSContext* cx, HandleObject regexp, HandleString input, - int32_t lastIndex, bool sticky, int32_t* endIndex); + uint32_t lastIndex, bool sticky, int32_t* endIndex); /* * The following functions are for use by self-hosted code. diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 951f68704da..2e8281e207a 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -1751,7 +1751,7 @@ class OutOfLineRegExpMatcher : public OutOfLineCodeBase }; typedef bool (*RegExpMatcherRawFn)(JSContext* cx, HandleObject regexp, HandleString input, - int32_t lastIndex, bool sticky, + uint32_t lastIndex, bool sticky, MatchPairs* pairs, MutableHandleValue output); static const VMFunction RegExpMatcherRawInfo = FunctionInfo(RegExpMatcherRaw); @@ -1916,7 +1916,7 @@ class OutOfLineRegExpTester : public OutOfLineCodeBase }; typedef bool (*RegExpTesterRawFn)(JSContext* cx, HandleObject regexp, HandleString input, - int32_t lastIndex, bool sticky, int32_t* result); + uint32_t lastIndex, bool sticky, int32_t* result); static const VMFunction RegExpTesterRawInfo = FunctionInfo(RegExpTesterRaw); void