From 86b5267ac4c2f169f105a1ea30cdf2eb0ea0b5dc Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 4 Jan 2018 14:49:12 -0500 Subject: Make indices for CXFA_List be size_t instead of int32_t Change-Id: Id825e027a337636bb779f09bc0b1c6985a781fa1 Reviewed-on: https://pdfium-review.googlesource.com/22257 Commit-Queue: Ryan Harrison Reviewed-by: dsinclair --- fxjs/xfa/cjx_list.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fxjs/xfa/cjx_list.cpp') diff --git a/fxjs/xfa/cjx_list.cpp b/fxjs/xfa/cjx_list.cpp index 57087a8492..9cbd32d352 100644 --- a/fxjs/xfa/cjx_list.cpp +++ b/fxjs/xfa/cjx_list.cpp @@ -76,12 +76,13 @@ CJS_Return CJX_List::item(CJS_V8* runtime, if (params.size() != 1) return CJS_Return(JSGetStringFromID(JSMessage::kParamError)); - int32_t iIndex = runtime->ToInt32(params[0]); - if (iIndex < 0 || static_cast(iIndex) >= GetXFAList()->GetLength()) + int32_t index = runtime->ToInt32(params[0]); + size_t cast_index = static_cast(index); + if (index < 0 || cast_index >= GetXFAList()->GetLength()) return CJS_Return(JSGetStringFromID(JSMessage::kInvalidInputError)); return CJS_Return(runtime->NewXFAObject( - GetXFAList()->Item(iIndex), + GetXFAList()->Item(cast_index), GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate())); } -- cgit v1.2.3