We need to add checks that ensure that some core variables are valid, so
that we avoid printing out garbage data. The worst that could happen is
that an non-initialized variable is being printed as something with
123123432 children instead of 0.
Details
Details
- Reviewers
danilashtefan - Commits
- rGa48501150b9e: Make some libstd++ formatters safer
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/main.cpp | ||
---|---|---|
16 | It'd be better to be more explicit about the contents of this "uninitialized" memory. Otherwise you run the risk of flakyness due to random data showing up in that block of memory. |
lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered/main.cpp | ||
---|---|---|
16 | good one |
It'd be better to be more explicit about the contents of this "uninitialized" memory.
For example you could allocate a char array of an appropriate size, memset it to zero (or whatever), and then cast its address to a map pointer.
Otherwise you run the risk of flakyness due to random data showing up in that block of memory.