mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-01 14:54:29 +08:00
GP-3186 Add 0 size exports to consistency check for subtables
This commit is contained in:
@@ -1004,7 +1004,7 @@ bool ConsistencyChecker::checkSectionTruncations(Constructor *ct,ConstructTpl *c
|
|||||||
bool ConsistencyChecker::checkSubtable(SubtableSymbol *sym)
|
bool ConsistencyChecker::checkSubtable(SubtableSymbol *sym)
|
||||||
|
|
||||||
{
|
{
|
||||||
int4 tablesize = 0;
|
int4 tablesize = -1;
|
||||||
int4 numconstruct = sym->getNumConstructors();
|
int4 numconstruct = sym->getNumConstructors();
|
||||||
Constructor *ct;
|
Constructor *ct;
|
||||||
bool testresult = true;
|
bool testresult = true;
|
||||||
@@ -1033,9 +1033,9 @@ bool ConsistencyChecker::checkSubtable(SubtableSymbol *sym)
|
|||||||
}
|
}
|
||||||
seennonemptyexport = true;
|
seennonemptyexport = true;
|
||||||
int4 exsize = recoverSize(exportres->getSize(),ct);
|
int4 exsize = recoverSize(exportres->getSize(),ct);
|
||||||
if (tablesize == 0)
|
if (tablesize == -1)
|
||||||
tablesize = exsize;
|
tablesize = exsize;
|
||||||
if ((exsize!=0)&&(exsize != tablesize)) {
|
if (exsize != tablesize) {
|
||||||
ostringstream msg;
|
ostringstream msg;
|
||||||
msg << "Table '" << sym->getName() << "' has inconsistent export size; ";
|
msg << "Table '" << sym->getName() << "' has inconsistent export size; ";
|
||||||
msg << "Constructor starting at line " << dec << ct->getLineno() << " is first conflict";
|
msg << "Constructor starting at line " << dec << ct->getLineno() << " is first conflict";
|
||||||
|
|||||||
+3
-3
@@ -725,7 +725,7 @@ class ConsistencyChecker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkSubtable(SubtableSymbol sym) {
|
private boolean checkSubtable(SubtableSymbol sym) {
|
||||||
int tablesize = 0;
|
int tablesize = -1;
|
||||||
int numconstruct = sym.getNumConstructors();
|
int numconstruct = sym.getNumConstructors();
|
||||||
Constructor ct;
|
Constructor ct;
|
||||||
boolean testresult = true;
|
boolean testresult = true;
|
||||||
@@ -757,10 +757,10 @@ class ConsistencyChecker {
|
|||||||
}
|
}
|
||||||
seennonemptyexport = true;
|
seennonemptyexport = true;
|
||||||
int exsize = recoverSize(exportres.getSize(), ct);
|
int exsize = recoverSize(exportres.getSize(), ct);
|
||||||
if (tablesize == 0) {
|
if (tablesize == -1) {
|
||||||
tablesize = exsize;
|
tablesize = exsize;
|
||||||
}
|
}
|
||||||
if ((exsize != 0) && (exsize != tablesize)) {
|
if (exsize != tablesize) {
|
||||||
compiler.reportError(ct.location, String.format(
|
compiler.reportError(ct.location, String.format(
|
||||||
"Table '%s' has inconsistent export size; Constructor at %s is first conflict",
|
"Table '%s' has inconsistent export size; Constructor at %s is first conflict",
|
||||||
sym.getName(), ct.location));
|
sym.getName(), ct.location));
|
||||||
|
|||||||
Reference in New Issue
Block a user