[PATCH] D109217: [llvm-dwarfdump] Fix unsigned overflow when calculating stats
Djordje Todorovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 7 03:28:26 PDT 2021
djtodoro added inline comments.
================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:760
/// version.
- unsigned Version = 8;
- unsigned VarParamTotal = 0;
- unsigned VarParamUnique = 0;
- unsigned VarParamWithLoc = 0;
- unsigned NumFunctions = 0;
- unsigned NumInlinedFunctions = 0;
- unsigned NumFuncsWithSrcLoc = 0;
- unsigned NumAbstractOrigins = 0;
- unsigned ParamTotal = 0;
- unsigned ParamWithType = 0;
- unsigned ParamWithLoc = 0;
- unsigned ParamWithSrcLoc = 0;
- unsigned LocalVarTotal = 0;
- unsigned LocalVarWithType = 0;
- unsigned LocalVarWithSrcLoc = 0;
- unsigned LocalVarWithLoc = 0;
+ unsigned Version = 9;
+ uint64_t VarParamTotal = 0;
----------------
Orlando wrote:
> I'm not sure how much this matters but looking at the comment above I don't think a version bump is necessary for this patch? Any input that didn't trip the assertions previously will still have the same output with the patch applied.
I think since this is a bug fix we should bump it -- e.g., a stat number could have been 0 (as a consequence of the bug), and now it will be 2^32 for example, right? I think that this is the purpose behind the stats version.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109217/new/
https://reviews.llvm.org/D109217
More information about the llvm-commits
mailing list