[llvm-readobj] - Change how we create DynRegionInfo objects. NFCI.
Currently we have `checkDRI` and two `createDRIFrom` methods which are used to create `DynRegionInfo` objects. And we have an issue: constructions like: `ObjF->getELFFile()->base() + P->p_offset` that are used in `createDRIFrom` functions might overflow. I had to revert `D85519` which triggered such UBSan failure. This NFC, simplifies and generalizes how we create `DynRegionInfo` objects. It will allow us to introduce more/better validation checks in a single place. It also will allow to change `createDRI` to return `Expected<>` so that we will be able to stop using the `reportError`, which is used inside currently, and have a warning instead. Differential revision: https://reviews.llvm.org/D86297
Loading
Please sign in to comment