diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-01-04 14:49:12 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 20:09:31 +0000 |
commit | 86b5267ac4c2f169f105a1ea30cdf2eb0ea0b5dc (patch) | |
tree | 3915dfbd64eee6070f7c853b1f81acd38156a7ce /fxjs/xfa/cjx_list.cpp | |
parent | de3f3fc5e16a2ee4fad2bdc0cda9e2ce73fd4fe3 (diff) | |
download | pdfium-86b5267ac4c2f169f105a1ea30cdf2eb0ea0b5dc.tar.xz |
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 <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_list.cpp')
-rw-r--r-- | fxjs/xfa/cjx_list.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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<size_t>(iIndex) >= GetXFAList()->GetLength()) + int32_t index = runtime->ToInt32(params[0]); + size_t cast_index = static_cast<size_t>(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())); } |