Problem : Double free @ 4249. Diagnostic : False positive. Rationale : Codepath leading to error contains two consecutive iterations in which `if (--j < 0)` is true. That executes `free` two consecutive times with the same value (hislen - 1) for j, with leads to double free. Now, that can only happen with j == 0 && hislen == 1. And that would imply j == hisidx[type] too, which would take the following break. So, the error codepath cannot really happen, but the compiler cannot deduce the last implication. Resolution : We have two possible solutions for this: 1.- Comparing value of j before and after updating it, and breaking out of iteration if equal. That changes nothing in functionality, but teaches the compiler his proposed error codepath is impossible. 2.- Nullify pointer after freeing. This way, the compiler still thinks his error codepath is possible, but it's not an error anymore, as free(NULL) is a no-op. We opt for solution 2, as solution 1 requires adding logic that adds nothing (and having to explain that clearly in aside comments) just for the purpose of silencing warning. On the other hand, solution 2 improves the code, adding something considered good practice in any case, and therefore doesn't require further explanation. |
||
---|---|---|
.ci | ||
cmake | ||
config | ||
contrib | ||
runtime | ||
scripts | ||
src/nvim | ||
test | ||
third-party | ||
.gitignore | ||
.travis.yml | ||
.valgrind.supp | ||
BACKERS.md | ||
clint-files.txt | ||
clint.py | ||
CMakeLists.txt | ||
CONTRIBUTING.md | ||
Doxyfile | ||
LICENSE | ||
Makefile | ||
neovim.rb | ||
README.md | ||
uncrustify.cfg |
Website | Wiki | Documentation | Mailing List | Twitter | Reddit | Bountysource
Neovim is a project that seeks to aggressively refactor Vim in order to:
- Simplify maintenance and encourage contributions
- Split the work between multiple developers
- Enable the implementation of new/modern user interfaces without any modifications to the core source
- Improve extensibility with a new plugin architecture
For lots more details, see the wiki!
What's been done so far
- Job control (work with processes asynchronously)
- msgpack remote API
- Performance, reliability, and portability improvements
- See the progress page for a comprehensive list.
What's being worked on now
- Port all IO to libuv
- Lots of refactoring
- A VimL => Lua transpiler
How do I get it?
There is a formula for OSX/homebrew, a PKGBUILD for Arch Linux, RPM, deb, and more. See the wiki!
Community
Join the community on IRC in #neovim on Freenode or the mailing list
Contributing
...would be awesome! See the wiki for more details.
License
Neovim is licensed under the terms of the Apache 2.0 license, except for parts that were contributed under the Vim license.
-
Contributions committed before b17d96 by authors who did not sign the Contributor License Agreement (CLA) remain under the Vim license.
-
Contributions committed after b17d96 are licensed under Apache 2.0 unless those contributions were copied from Vim (identified in the commit logs by the
vim-patch
token).
See LICENSE
for details.
Vim is Charityware. You can use and copy it as much as you like, but you are
encouraged to make a donation for needy children in Uganda. Please see the
kcc section of the vim docs or visit the ICCF web site, available at these URLs:
http://iccf-holland.org/
http://www.vim.org/iccf/
http://www.iccf.nl/
You can also sponsor the development of Vim. Vim sponsors can vote for
features. The money goes to Uganda anyway.