This commit is contained in:
2025-03-12 12:37:19 +03:00
committed by Dudarenko
parent 0c9f0664fd
commit d4fb323f86
428 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
#include "../Utils/leak_detector.h"
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <string>
#include "dvm.h"
#include "verifications.h"
#include "../Utils/utils.h"
#include "../Utils/errors.h"
int VerifyFile(SgFile *file)
{
int funcNum = file->numberOfFunctions();
int isError = 0;
for (int i = 0; i < funcNum; ++i)
{
SgStatement *st = file->functions(i);
SgStatement *lastNode = st->lastNodeOfStmt();
while (st != lastNode)
{
if (st == NULL)
{
__spf_print(1, "Found errors in Sage structures in file %s, -1\n", file->filename());
isError = -1;
break;
}
if (st->variant() == CONTAINS_STMT)
break;
st = st->lexNext();
}
if (isError != 0)
break;
}
return isError;
}