MCPcopy Create free account
hub / github.com/avast/retdec / getRange

Method getRange

src/common/function.cpp:185–207  ·  view source on GitHub ↗

* Get function containing the address @p a. */

Source from the content-addressed store, hash-verified

183 * Get function containing the address @p a.
184 */
185const retdec::common::Function* FunctionSet::getRange(
186 const retdec::common::Address& a) const
187{
188 if (empty())
189 {
190 return nullptr;
191 }
192
193 auto pos = lower_bound(a);
194
195 if (pos == end())
196 {
197 auto last = rbegin();
198 return (last->contains(a)) ? (&(*last)) : (nullptr);
199 }
200
201 if (pos != begin() && pos->getStart() != a)
202 {
203 pos--;
204 }
205
206 return pos->contains(a) ? &(*pos) : nullptr;
207}
208
209} // namespace common
210} // namespace retdec

Callers 4

mainFunction · 0.45
getPrimaryMethod · 0.45
getAlternativeMethod · 0.45
TEST_FFunction · 0.45

Calls 1

containsMethod · 0.45

Tested by 1

TEST_FFunction · 0.36