[BOLT] Do not assert on bad data

Summary:
A test is asserting on impossible addresses coming from
perf.data, instead of just reporting it as bad data. Fix this behavior.

(cherry picked from FBD6835590)
This commit is contained in:
Rafael Auler 2018-01-29 10:37:30 -08:00 committed by Maksim Panchenko
parent 626e977c4a
commit 48370744d9
1 changed files with 1 additions and 2 deletions

View File

@ -307,9 +307,8 @@ bool BinaryFunction::recordEntry(uint64_t To, bool Mispred, uint64_t Count) {
}
bool BinaryFunction::recordExit(uint64_t From, bool Mispred, uint64_t Count) {
if (!isSimple())
if (!isSimple() || From > getSize())
return false;
assert(From <= getSize() && "wrong From address");
if (!hasProfile())
ExecutionCount = 0;