summaryrefslogtreecommitdiff
path: root/core/fxcrt/include/fx_basic.h
diff options
context:
space:
mode:
authorhans <hans@chromium.org>2016-05-16 12:25:44 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-16 12:25:44 -0700
commit06f457216f45093dc5dff12055733aa426c26c59 (patch)
tree177397bc0f0502663ddae64afe008540b39360a2 /core/fxcrt/include/fx_basic.h
parent3f80c864d5318d4d80ac811d42c92d8f63e0b5ac (diff)
downloadpdfium-06f457216f45093dc5dff12055733aa426c26c59.tar.xz
Fix binding of null pointer dereference to reference typechromium/2740chromium/2739
A new Clang warning complains about this, and especially for the function returning a reference, it seems like a bad idea. BUG=none Review-Url: https://codereview.chromium.org/1986453002
Diffstat (limited to 'core/fxcrt/include/fx_basic.h')
-rw-r--r--core/fxcrt/include/fx_basic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h
index 7121ffcd0b..59d72b8f5a 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -277,7 +277,7 @@ class CFX_ArrayTemplate : public CFX_BasicArray {
const TYPE GetAt(int nIndex) const {
if (nIndex < 0 || nIndex >= m_nSize) {
- return (const TYPE&)(*(volatile const TYPE*)NULL);
+ PDFIUM_IMMEDIATE_CRASH();
}
return ((const TYPE*)m_pData)[nIndex];
}
@@ -292,7 +292,7 @@ class CFX_ArrayTemplate : public CFX_BasicArray {
TYPE& ElementAt(int nIndex) {
if (nIndex < 0 || nIndex >= m_nSize) {
- return *(TYPE*)NULL;
+ PDFIUM_IMMEDIATE_CRASH();
}
return ((TYPE*)m_pData)[nIndex];
}