Fix memset-of-non-POD bug.

PROG contains vector, but was memset.
This commit is contained in:
nemerle 2016-05-19 16:17:08 +02:00
parent 1df7cb3be4
commit b60903306f
2 changed files with 14 additions and 15 deletions

View File

@ -3,21 +3,21 @@
#include <vector> #include <vector>
struct PROG /* Loaded program image parameters */ struct PROG /* Loaded program image parameters */
{ {
int16_t initCS; int16_t initCS=0;
int16_t initIP; /* These are initial load values */ int16_t initIP=0; /* These are initial load values */
int16_t initSS; /* Probably not of great interest */ int16_t initSS=0; /* Probably not of great interest */
uint16_t initSP; uint16_t initSP=0;
bool fCOM; /* Flag set if COM program (else EXE)*/ bool fCOM=false; /* Flag set if COM program (else EXE)*/
int cReloc; /* No. of relocation table entries */ int cReloc=0; /* No. of relocation table entries */
std::vector<uint32_t> relocTable; /* Ptr. to relocation table */ std::vector<uint32_t> relocTable; /* Ptr. to relocation table */
uint8_t * map; /* Memory bitmap ptr */ uint8_t * map=nullptr; /* Memory bitmap ptr */
int cProcs; /* Number of procedures so far */ int cProcs=0; /* Number of procedures so far */
int offMain; /* The offset of the main() proc */ int offMain=0; /* The offset of the main() proc */
uint16_t segMain; /* The segment of the main() proc */ uint16_t segMain=0; /* The segment of the main() proc */
bool bSigs; /* True if signatures loaded */ bool bSigs=false; /* True if signatures loaded */
int cbImage; /* Length of image in bytes */ int cbImage=0; /* Length of image in bytes */
uint8_t * Imagez; /* Allocated by loader to hold entire program image */ uint8_t * Imagez=nullptr; /* Allocated by loader to hold entire program image */
int addressingMode; int addressingMode=0;
public: public:
const uint8_t *image() const {return Imagez;} const uint8_t *image() const {return Imagez;}
void displayLoadInfo(); void displayLoadInfo();

View File

@ -15,7 +15,6 @@ OPTION option; /* Command line options */
Project *Project::s_instance = nullptr; Project *Project::s_instance = nullptr;
Project::Project() : callGraph(nullptr) Project::Project() : callGraph(nullptr)
{ {
memset(&prog,0,sizeof(prog));
} }
void Project::initialize() void Project::initialize()
{ {