From 91773b41e2fb751ea4171bd20c9c04e1b8aa3e8e Mon Sep 17 00:00:00 2001 From: Alessandro Di Federico Date: Sat, 12 Aug 2017 15:15:29 +0200 Subject: [PATCH] Serialize jump target reasons after FBD Serialization (in the form of the `revamb.jt.reasons` metadata) of the reason why a certain address is a jump target has been moved from `JumpTargetManager::finalizeJumpTargets` to a new function (`JumpTargetManager::createJTReasonMD`) which is invoked after the function boundaries detection algorithm has been run. --- codegenerator.cpp | 2 ++ jumptargetmanager.h | 1 + 2 files changed, 3 insertions(+) diff --git a/codegenerator.cpp b/codegenerator.cpp index 6bd678ef7..fecbf885b 100644 --- a/codegenerator.cpp +++ b/codegenerator.cpp @@ -921,6 +921,8 @@ void CodeGenerator::translate(uint64_t VirtualAddress) { FPM.run(*MainFunction); } + JumpTargets.createJTReasonMD(); + JumpTargets.noReturn().cleanup(); Translator.finalizeNewPCMarkers(CoveragePath); diff --git a/jumptargetmanager.h b/jumptargetmanager.h index ee40effc5..59f861360 100644 --- a/jumptargetmanager.h +++ b/jumptargetmanager.h @@ -486,6 +486,7 @@ public: freeContainer(UnusedCodePointers); } + void createJTReasonMD() { // Tag each jump target with its reasons for (auto &P : JumpTargets) { JumpTarget &JT = P.second;