Conversation
|
more false positives. unique_ptr is not a vector. ping @kevinbackhouse |
|
some more make_uniques. Let's see if it complains now. |
2f35ca3 to
25423f4
Compare
|
@neheb: The "Unsafe Vector Access" CodeQL query is something that I wrote myself and it's definitely not perfect. The fuzzer found quite a few crashes that could have been prevented by using Are some of these changes just attempts to silence the CodeQL alerts? For example, is replacing |
|
The last commit changes to unique_ptr as only a raw pointer is used. No vector functionality like push_back. Probably uses less memory. As for the first, it looks like get() is just used to avoid having a second smart pointer. I don’t know if that’s a good idea. |
|
I'll rebase once that's merged. |
4016077 to
e07c40f
Compare
|
The |
fbd7334 to
3a3d02a
Compare
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
No need to initialize the base class for copy constructors. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
unique_ptr does not have at() Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Some platforms such as Fedora use zlib-ng instead of zlib, which has different compressed output. Compressed output shouldn't be tested anyway. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
No need for it. Signed-off-by: Rosen Penev <rosenp@gmail.com>
E2513: Invalid unescaped character esc, use "\x1B" instead. (invalid-character-esc) Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
It's only used in a single function. No need to have it in the class. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
When calling std::vector::resize(0), Cygwin warns on it. Add a check to avoid that. warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
@kevinbackhouse I was right to question this get() usage. clang-analyzer complains with: add() eventually calls release() on the pointer which also ends up freeing it. so m.get() returns garbage. Supposedly. |
@neheb: which log file is this in? Or can you give me instructions to reproduce it locally? |
assuming your cmake configuration includes -DCMAKE_EXPORT_COMPILE_COMMANDS=ON , run |
8715d78 to
4899a94
Compare
Signed-off-by: Rosen Penev <rosenp@gmail.com>
add calls doAdd which calls push_back and release(). It's more reliable to call back() in this case as the formerly unique_ptr is at the end. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
Yes |
kevinbackhouse
left a comment
There was a problem hiding this comment.
I think this looks good now. In future though, please could you not bundle so many unrelated changes into one PR? I find smaller PRs easier to review. Also, if a change causes a regression, I find it's easier to track down what caused it if each individual PR is smaller.
I'm not sure about the shared_ptr change. Cyclic references are avoided by passing by value. I doubt there's much overhead here.