| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
| |
Problem : Dereference of null pointer @ 18216.
Diagnostic : False positive.
Rationale : `hi` and `done` are static. Intended usage is for the first
call to have idx == 0, so that they are initialized.
Resolution : Assert hi after (optional) initialization.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : Bad free @ 16076.
Diagnostic : Real issue.
Rationale : A non-allocated string is set at 4127, which later on can
be tried to be freed if aborting.
Resolution : Detect particular case (func with empty name) and don't
free in that case.
Another solution (use allocated string) was tried before,
but it produced a leak difficult to solve.
Finally applied solution works, but it produces a new false
positive warning (Np dereference at 13763), deactivated by
`assert(ptrs[i].item->li_next)`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : Result of operation is garbage or undefined @ 13565.
Diagnostic : Multithreading issue.
Rationale : Problem occurs only if global (static) variable
`item_compare_keep_zero` changes after being used by
`do_sort_uniq` but before being used by `item_compare` or
`item_compare2`.
Resolution : This is not an intra-function problem, as other MI's
before, but rather an inter-function one. Thus, it can't be
solved by using local copy of global. Therefore, we are
forced to do a bit refactoring. We can't simply add a bool
param to item_compare/item_compare2, as they couldn't be
passed to qsort() that way. So, item_compare/item_compare2
are added a bool param and curried versions of them are
added and used in their place.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : Out-of-bound array access @ 5737.
Diagnostic : False positive.
Rationale : Situation is intentional. `dictitem_T` is a prefix all dict
items whill share, but actual size of each item will be
different depending on its key length. `di_key` array field
is declared of size 1 just to have a field name, but real
size will vary for each item.
Resolution : Make analyzer ignore it.
This could be refactored to use C99-allowed variable length
arrays, but eval.c is bound to dissappear, so no effort is
done in that sense.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem : Dereference of null pointer @ 2273.
Diagnostic : False positive.
Rationale : Suggested error would happen when assigning an rvalue with
more items than the lvalue. Then we would enter conditional
at:
```
if (lp->ll_li->li_next == NULL) {
/* Need to add an empty item. */
list_append_number(lp->ll_list, 0);
}
lp->ll_li = lp->ll_li->li_next;
```
Analyzer thinks the value assigned to lp->ll_li is still
NULL and is hit on the next iteration.
Resolution : Assert lp->ll_li->li_next is not null anymore after
list_append_number().
|
| |
|
|
|
|
|
| |
Replace references to provider_call/provider_has with the new functions
eval_call_provider/eval_has_provider.
|
|
|
|
|
|
|
|
|
|
|
| |
These use autoloaded vimscript to replace the provider_call/provider_has
functions, moving the implementation of providers to pure vimscript(we lose
nothing since vimscript can also call msgpack-rpc functions).
When calling the rpcrequest function from a provider, temporarily switch to the
caller scope. This is required for compatibility with legacy plugins, because
they may depend on scope information that changes when "leaving" the C stack to
enter the vimscript stack.
|
|\
| |
| | |
jobstart: Check prg arguments for NULL.
|
| | |
|
|/
|
|
|
|
|
|
| |
Problem: Whan part of a list is locked it's possible to make changes.
Solution: Check if any of the list items is locked before make a change.
(ZyX)
https://code.google.com/p/vim/source/detail?r=v7-4-419
|
|
|
|
| |
This is the behavior on vim's `systemlist()`.
|
|
|
|
|
|
|
|
| |
Use save_tv_as_string(), same as vimL system(). This also makes
jobsend() more liberal in what it can accept. For example,
`jobsend(j, 123)` is now valid.
Closes #1176
|
|
|
|
|
|
|
|
| |
Factor out string_to_list() from f_system()'s implementation
and use that to set job_data. This has the technical advantage of
preserving NULs, and may be more convenient for users.
Required for #1176.
|
|
|
|
| |
Only read up to the last newline in push_job_event().
|
|
|
|
|
| |
Note: No effort is done on refactoring anything in eval module, as it
will be eventually dropped.
|
|
|
|
|
| |
This seems to have been disabled in the transition from vim to neovim,
re-enable it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit @264e0d872c("Remove automatic event deferral") removed the immediate
event queue because event deferral now had to be explicit. The problem is that
while some events don't need to be deferred, they still can result in recursive
`event_poll` calls, and recursion is not supported by libuv. Examples of those
are msgpack-rpc requests while a server->client request is pending, or signals
which can call `mch_exit`(and that will result in `uv_run` calls).
To fix the problem, this reintroduces the immediate event queue for events that
can potentially result in event loop recursion. The non-deferred events are
still processed in `event_poll`, but only after `uv_run` returns.
|
|
|
|
|
|
|
|
| |
Passing NULL as the callback for stdout/stderr will result in job_start ignoring
stdout/stderr, respectively. A 'writable' boolean argument was also added, and
when false `job_start` will ignore stdin.
Also, refactor os_system to allow passing NULL as the `output` argument.
|
|\
| |
| | |
coverity/71507: Unchecked return value (CHECKED_RETURN)
|
| |
| |
| |
| | |
Don't check for err->set since object_to_vim always return false when error is set
|
| |
| |
| |
| |
| | |
This function can be used by API clients to execute a command and capture the
output.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The JobEvent structure may refer to a job after it has been freed. Apply
@tarruda's patch to extract the job data before pushing the event.
Also, fix the type, "data" -> "job", in on_job_exit() and free the job
name in the last job event.
|
| |
| |
| |
| |
| |
| | |
JobActivity autocommands run vimscript and must be executed on Nvim main loop.
Since the previous commit removed automatic calls to `event_push` on RStream/Job
callbacks, this adds it back, but in eval.c where job control is implemented.
|
|/
|
|
|
| |
Create the msgpack_rpc subdirectory and move all modules that deal with
msgpack-rpc to it. Also merge msgpack_rpc.c into msgpack_rpc/helpers.c
|
|
|
|
|
|
|
|
| |
RBuffer instances represent the internal buffer used by RStreams.
This changes RStream constructor to receive RBuffer pointers and adds a set of
RBuffer methods that expose the lower level buffer manipulation to consumers of
the RStream API.
|
|\
| |
| | |
Remove FOR_ALL_WINDOWS and replace with FOR_ALL_WINDOWS_IN_TAB(curtab)
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Replace NULs with SOH to restore the old behaviour of get_cmd_output().
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Using systemlist() may cause a crash and does not handle NUL
characters properly.
Solution: Increase the reference count, allocate memory by length. (Yasuhiro
Matsumoto)
https://code.google.com/p/vim/source/detail?r=v7-4-256
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Cannot distinguish between NL and NUL in output of system().
Solution: Add systemlist(). (ZyX)
https://code.google.com/p/vim/source/detail?r=v7-4-248
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: When passing input to system() there is no way to keep NUL and
NL characters separate.
Solution: Optionally use a list for the system() input. (ZyX)
https://code.google.com/p/vim/source/detail?r=v7-4-247
Implement write_list_to_string() as well since write_list() only works
on files.
|
|/
|
|
|
|
|
| |
Problem: "foo bar" sorts before "foo" with sort(). (John Little)
Solution: Avoid putting quotes around strings before comparing them.
https://code.google.com/p/vim/source/detail?r=v7-4-411
|
| |
|
| |
|
|\
| |
| | |
vim-patch:7.4.392
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Not easy to detect type of command line window.
Solution: Add the getcmdwintype() function. (Jacob Niehus)
https://code.google.com/p/vim/source/detail?r=v7-4-392
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add error type information to `Error`
- Rename `set_api_error` to `api_set_error` for consistency with other api_*
functions/macros.
- Refactor the api_set_error macro to accept formatted strings and error types
- Improve error messages
- Wrap error messages with gettext macro
- Refactor msgpack-rpc serialization to transform Error instances into [type,
message] arrays
- Add error type information to API metadata
- Normalize nvim->client and client->nvim error handling(change
channel_send_call to accept an Error pointer instead of the `errored` boolean
pointer)
- Use macro to initialize Error structures
|
|\
| |
| | |
vim-patch:7.4.235
|
| |
| |
| |
| |
| |
| |
| | |
Problem: It is not easy to get the full path of a command.
Solution: Add the exepath() function.
https://code.google.com/p/vim/source/detail?r=5ab2946f7ce560985830fbc3c453bb0f7a01f385
|
| |
| |
| |
| |
| |
| |
| | |
Problem: Changing the return value of getpos() causes an error. (Jie Zhu)
Solution: Revert getpos() and add getcurpos().
https://code.google.com/p/vim/source/detail?r=332a5c2b2956d9b18d85268a724d01deea27ec83
|
|/
|
|
|
|
|
| |
Problem: getpos()/setpos() don't include curswant.
Solution: Add a fifth number when getting/setting the cursor.
https://code.google.com/p/vim/source/detail?r=ccac0aa34eeaf46dad4b831461a532fc3fe71096
|
|\
| |
| | |
vim-patch:7.4.341, 7.4.347, 7.4.351, 7.4.358
|
| |
| |
| |
| |
| |
| |
| |
| | |
Problem: Sort is not always stable.
Solution: Add an index instead of relying on the pointer to remain the same.
Idea by Jun Takimoto.
https://code.google.com/p/vim/source/detail?r=v7-4-358
|
| |
| |
| |
| |
| |
| |
| | |
Problem: sort() is not stable.
Solution: When the items are identical, compare the pointers.
https://code.google.com/p/vim/source/detail?r=v7-4-351
|
| |
| |
| |
| |
| |
| |
| | |
Problem: sort() doesn't handle numbers well.
Solution: Add an argument to specify sorting on numbers. (Christian Brabandt)
https://code.google.com/p/vim/source/detail?r=adc4a84f72eb44dae657af713922a6e2c1f64ae3
|
| |
| |
| |
| | |
To follow the convention of 'nvim' for technical references
|