Fix global analyzer not following recursive structs
This commit is contained in:
parent
0f182d2d6d
commit
433270f90f
|
@ -516,6 +516,18 @@ void GlobalAnalyzer::AnalyzeGlobalVariable(Declaration* dec)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GlobalAnalyzer::AnalyzeInit(Declaration* mdec)
|
||||||
|
{
|
||||||
|
while (mdec)
|
||||||
|
{
|
||||||
|
if (mdec->mValue)
|
||||||
|
RegisterProc(Analyze(mdec->mValue, mdec, false));
|
||||||
|
else if (mdec->mParams)
|
||||||
|
AnalyzeInit(mdec->mParams);
|
||||||
|
mdec = mdec->mNext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Declaration * GlobalAnalyzer::Analyze(Expression* exp, Declaration* procDec, bool lhs)
|
Declaration * GlobalAnalyzer::Analyze(Expression* exp, Declaration* procDec, bool lhs)
|
||||||
{
|
{
|
||||||
Declaration* ldec, * rdec;
|
Declaration* ldec, * rdec;
|
||||||
|
@ -532,13 +544,7 @@ Declaration * GlobalAnalyzer::Analyze(Expression* exp, Declaration* procDec, boo
|
||||||
AnalyzeProcedure(exp->mDecValue->mValue, exp->mDecValue);
|
AnalyzeProcedure(exp->mDecValue->mValue, exp->mDecValue);
|
||||||
else if (exp->mDecValue->mType == DT_CONST_STRUCT)
|
else if (exp->mDecValue->mType == DT_CONST_STRUCT)
|
||||||
{
|
{
|
||||||
Declaration* mdec = exp->mDecValue->mParams;
|
AnalyzeInit(exp->mDecValue->mParams);
|
||||||
while (mdec)
|
|
||||||
{
|
|
||||||
if (mdec->mValue)
|
|
||||||
RegisterProc(Analyze(mdec->mValue, mdec, false));
|
|
||||||
mdec = mdec->mNext;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (exp->mDecValue->mType == DT_CONST_POINTER)
|
else if (exp->mDecValue->mType == DT_CONST_POINTER)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,6 +30,8 @@ protected:
|
||||||
GrowingArray<Declaration*> mCalledFunctions, mCallingFunctions, mVariableFunctions, mFunctions;
|
GrowingArray<Declaration*> mCalledFunctions, mCallingFunctions, mVariableFunctions, mFunctions;
|
||||||
GrowingArray<Declaration*> mGlobalVariables;
|
GrowingArray<Declaration*> mGlobalVariables;
|
||||||
|
|
||||||
|
void AnalyzeInit(Declaration* mdec);
|
||||||
|
|
||||||
Declaration* Analyze(Expression* exp, Declaration* procDec, bool lhs);
|
Declaration* Analyze(Expression* exp, Declaration* procDec, bool lhs);
|
||||||
|
|
||||||
bool MarkCycle(Declaration* rootDec, Declaration* procDec);
|
bool MarkCycle(Declaration* rootDec, Declaration* procDec);
|
||||||
|
|
|
@ -74,7 +74,7 @@ int main2(int argc, const char** argv)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
strcpy(strProductName, "oscar64");
|
strcpy(strProductName, "oscar64");
|
||||||
strcpy(strProductVersion, "1.20.207");
|
strcpy(strProductVersion, "1.20.208");
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
uint32_t length = sizeof(basePath);
|
uint32_t length = sizeof(basePath);
|
||||||
|
|
|
@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,20,207,0
|
FILEVERSION 1,20,208,0
|
||||||
PRODUCTVERSION 1,20,207,0
|
PRODUCTVERSION 1,20,208,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -43,12 +43,12 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "oscar64"
|
VALUE "CompanyName", "oscar64"
|
||||||
VALUE "FileDescription", "oscar64 compiler"
|
VALUE "FileDescription", "oscar64 compiler"
|
||||||
VALUE "FileVersion", "1.20.207.0"
|
VALUE "FileVersion", "1.20.208.0"
|
||||||
VALUE "InternalName", "oscar64.exe"
|
VALUE "InternalName", "oscar64.exe"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2021"
|
VALUE "LegalCopyright", "Copyright (C) 2021"
|
||||||
VALUE "OriginalFilename", "oscar64.exe"
|
VALUE "OriginalFilename", "oscar64.exe"
|
||||||
VALUE "ProductName", "oscar64"
|
VALUE "ProductName", "oscar64"
|
||||||
VALUE "ProductVersion", "1.20.207.0"
|
VALUE "ProductVersion", "1.20.208.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
|
@ -5233,15 +5233,15 @@
|
||||||
{
|
{
|
||||||
"Name" = "8:Microsoft Visual Studio"
|
"Name" = "8:Microsoft Visual Studio"
|
||||||
"ProductName" = "8:oscar64"
|
"ProductName" = "8:oscar64"
|
||||||
"ProductCode" = "8:{FEED3AD1-30EE-4FD2-954E-A54FFC19B2ED}"
|
"ProductCode" = "8:{30CBD281-E43B-4539-A830-C8EA3D9ECEEC}"
|
||||||
"PackageCode" = "8:{88265E1D-B2B8-4C78-A582-11E0B0CF7FB7}"
|
"PackageCode" = "8:{B24DA444-F39A-4974-97A1-BF31AB02202C}"
|
||||||
"UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}"
|
"UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}"
|
||||||
"AspNetVersion" = "8:2.0.50727.0"
|
"AspNetVersion" = "8:2.0.50727.0"
|
||||||
"RestartWWWService" = "11:FALSE"
|
"RestartWWWService" = "11:FALSE"
|
||||||
"RemovePreviousVersions" = "11:TRUE"
|
"RemovePreviousVersions" = "11:TRUE"
|
||||||
"DetectNewerInstalledVersion" = "11:TRUE"
|
"DetectNewerInstalledVersion" = "11:TRUE"
|
||||||
"InstallAllUsers" = "11:FALSE"
|
"InstallAllUsers" = "11:FALSE"
|
||||||
"ProductVersion" = "8:1.20.207"
|
"ProductVersion" = "8:1.20.208"
|
||||||
"Manufacturer" = "8:oscar64"
|
"Manufacturer" = "8:oscar64"
|
||||||
"ARPHELPTELEPHONE" = "8:"
|
"ARPHELPTELEPHONE" = "8:"
|
||||||
"ARPHELPLINK" = "8:"
|
"ARPHELPLINK" = "8:"
|
||||||
|
|
Loading…
Reference in New Issue