mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user