Index: src/regexp/regexp-utils.cc |
diff --git a/src/regexp/regexp-utils.cc b/src/regexp/regexp-utils.cc |
index f6ef076f2c38b781f58d4589e94801ce64130562..d40431866a391388b4e8ebfbbbe75e529e6bb2c5 100644 |
--- a/src/regexp/regexp-utils.cc |
+++ b/src/regexp/regexp-utils.cc |
@@ -174,8 +174,7 @@ MaybeHandle<Object> RegExpUtils::SetAdvancedStringIndex( |
ASSIGN_RETURN_ON_EXCEPTION(isolate, last_index_obj, |
Object::ToLength(isolate, last_index_obj), Object); |
- |
- const int last_index = Handle<Smi>::cast(last_index_obj)->value(); |
+ const int last_index = PositiveNumberToUint32(*last_index_obj); |
const int new_last_index = |
AdvanceStringIndex(isolate, string, last_index, unicode); |