File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -291,21 +291,21 @@ class ELFFile {
291291public:
292292 Expected<uint32_t > getPhNum () const {
293293 if (!RealPhNum) {
294- if (Error E = readShdrZero ())
294+ if (Error E = const_cast <ELFFile<ELFT> *>( this )-> readShdrZero ())
295295 return std::move (E);
296296 }
297297 return *RealPhNum;
298298 }
299299 Expected<uint32_t > getShNum () const {
300300 if (!RealShNum) {
301- if (Error E = readShdrZero ())
301+ if (Error E = const_cast <ELFFile<ELFT> *>( this )-> readShdrZero ())
302302 return std::move (E);
303303 }
304304 return *RealShNum;
305305 }
306306 Expected<uint32_t > getShStrNdx () const {
307307 if (!RealShStrNdx) {
308- if (Error E = readShdrZero ())
308+ if (Error E = const_cast <ELFFile<ELFT> *>( this )-> readShdrZero ())
309309 return std::move (E);
310310 }
311311 return *RealShStrNdx;
@@ -947,6 +947,8 @@ template <class ELFT> Error ELFFile<ELFT>::readShdrZero() {
947947 RealShNum = Header.e_shnum ;
948948 RealShStrNdx = Header.e_shstrndx ;
949949 }
950+
951+ return Error::success ();
950952}
951953
952954template <class ELFT >
You can’t perform that action at this time.
0 commit comments