mirror of
https://github.com/libAthena/athena.git
synced 2025-07-08 22:26:08 +00:00
proper string-size computation for binarySize
This commit is contained in:
parent
b6b54d0921
commit
f248d1746e
@ -841,7 +841,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeExprStr.size())
|
||||
if (sizeExprStr.size() && sizeExprStr.compare("-1"))
|
||||
fileOut << " __isz += (" << sizeExprStr << ");\n";
|
||||
else
|
||||
fileOut << " __isz += " << fieldName << ".size() + 1;\n";
|
||||
@ -879,7 +879,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
|
||||
++idx;
|
||||
}
|
||||
|
||||
if (sizeExprStr.size())
|
||||
if (sizeExprStr.size() && sizeExprStr.compare("-1"))
|
||||
fileOut << " __isz += (" << sizeExprStr << ") * 2;\n";
|
||||
else
|
||||
fileOut << " __isz += (" << fieldName << ".size() + 1) * 2;\n";
|
||||
@ -913,7 +913,7 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor<ATDNAEmitVisitor>
|
||||
}
|
||||
|
||||
|
||||
if (sizeExprStr.size())
|
||||
if (sizeExprStr.size() && sizeExprStr.compare("-1"))
|
||||
fileOut << " __isz += (" << sizeExprStr << ") * 2;\n";
|
||||
else
|
||||
fileOut << " __isz += (" << fieldName << ".size() + 1) * 2;\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user