-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some more fixes #3136
some more fixes #3136
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 <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
No need to initialize the base class for copy constructors. Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
unique_ptr does not have at() Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
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 <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
No need for it. Signed-off-by: Rosen Penev <[email protected]>
E2513: Invalid unescaped character esc, use "\x1B" instead. (invalid-character-esc) Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
It's only used in a single function. No need to have it in the class. Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
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 <[email protected]>
@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 <[email protected]>
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 <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
|
Yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.