OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a476ce7
)
Object: Small cleanup in COFFObjectFile::getSymbol
author
David Majnemer
<david.majnemer@gmail.com>
Thu, 11 Sep 2014 23:42:10 +0000
(23:42 +0000)
committer
David Majnemer
<david.majnemer@gmail.com>
Thu, 11 Sep 2014 23:42:10 +0000
(23:42 +0000)
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217648
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/Object/COFF.h
patch
|
blob
|
history
diff --git
a/include/llvm/Object/COFF.h
b/include/llvm/Object/COFF.h
index
ae79f8b
..
87e8cc2
100644
(file)
--- a/
include/llvm/Object/COFF.h
+++ b/
include/llvm/Object/COFF.h
@@
-569,10
+569,10
@@
public:
template <typename coff_symbol_type>
std::error_code getSymbol(uint32_t Index,
const coff_symbol_type *&Res) const {
- if (Index < getNumberOfSymbols())
- Res = reinterpret_cast<coff_symbol_type *>(getSymbolTable()) + Index;
- else
+ if (Index >= getNumberOfSymbols())
return object_error::parse_failed;
+
+ Res = reinterpret_cast<coff_symbol_type *>(getSymbolTable()) + Index;
return object_error::success;
}
ErrorOr<COFFSymbolRef> getSymbol(uint32_t index) const {