mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
FilePortion: force members initialization
This commit fixes a bug triggered by the fact that the constructor of the `FilePortion` class was not initializing fields featuring a "native" type (which are therefore not automatically zero-initialized). In particular, this bug was triggered when dealing with a dynamic binary lacking the sections for dynamic relocations.
This commit is contained in:
+9
-6
@@ -248,6 +248,15 @@ BinaryFile::BinaryFile(std::string FilePath,
|
||||
}
|
||||
|
||||
class FilePortion {
|
||||
private:
|
||||
bool HasAddress;
|
||||
bool HasSize;
|
||||
uint64_t Size;
|
||||
uint64_t Address;
|
||||
|
||||
public:
|
||||
FilePortion() : HasAddress(false), HasSize(false), Size(0), Address(0) { }
|
||||
|
||||
public:
|
||||
void setAddress(uint64_t Address) {
|
||||
HasAddress = true;
|
||||
@@ -305,12 +314,6 @@ public:
|
||||
abort();
|
||||
}
|
||||
|
||||
private:
|
||||
bool HasAddress;
|
||||
bool HasSize;
|
||||
uint64_t Size;
|
||||
uint64_t Address;
|
||||
|
||||
};
|
||||
|
||||
template<typename T, bool HasAddend>
|
||||
|
||||
Reference in New Issue
Block a user