ProgramCounterHandler: CSVs are internal

This commit fixes a bug that lead to be unable to instantiate from a
`Module` `ProgramCounterHandler`. The reason for this was that
`ProgramCounterHandler` was using `Module::getGlobalVariable` which, by
default, ignores variables with internal linkage.
This commit is contained in:
Alessandro Di Federico
2021-01-26 19:05:44 +01:00
parent 7399dee68b
commit e0073d8874
2 changed files with 5 additions and 5 deletions
@@ -222,10 +222,10 @@ protected:
public:
void setMissingVariables(llvm::Module *M) {
AddressCSV = M->getGlobalVariable(AddressName);
EpochCSV = M->getGlobalVariable(EpochName);
AddressSpaceCSV = M->getGlobalVariable(AddressSpaceName);
TypeCSV = M->getGlobalVariable(TypeName);
AddressCSV = M->getGlobalVariable(AddressName, true);
EpochCSV = M->getGlobalVariable(EpochName, true);
AddressSpaceCSV = M->getGlobalVariable(AddressSpaceName, true);
TypeCSV = M->getGlobalVariable(TypeName, true);
revng_assert(AddressCSV != nullptr and EpochCSV != nullptr
and AddressSpaceCSV != nullptr and TypeCSV != nullptr);
+1 -1
View File
@@ -93,7 +93,7 @@ public:
Result->setMissingVariables(M);
// Get is_thumb
Result->IsThumb = M->getGlobalVariable(IsThumbName);
Result->IsThumb = M->getGlobalVariable(IsThumbName, true);
revng_assert(Result->IsThumb != nullptr);
// Register pc and is_thumb as a CSV affecting the program counter