mirror of
https://github.com/neovim/neovim.git
synced 2026-01-22 13:12:54 +10:00
Fix warnings: eval.c: do_return(): Np dereference: FP.
Problem : Dereference of null pointer @ 18841.
Diagnostic : False positive.
Rationale : Suggested error path takes `reanimate` branch at 18827,
assigning `rettv = current_funccal->rettv`. Then,
inmediately after, it supposes rettv is null, which cannot
happen, since current_funccal->rettv should always be non
null.
Resolution : Assert current_funccal->rettv non null.
This commit is contained in:
@@ -18901,8 +18901,10 @@ int do_return(exarg_T *eap, int reanimate, int is_cmd, void *rettv)
|
||||
else {
|
||||
/* When undoing a return in order to make it pending, get the stored
|
||||
* return rettv. */
|
||||
if (reanimate)
|
||||
if (reanimate) {
|
||||
assert(current_funccal->rettv);
|
||||
rettv = current_funccal->rettv;
|
||||
}
|
||||
|
||||
if (rettv != NULL) {
|
||||
/* Store the value of the pending return. */
|
||||
|
||||
Reference in New Issue
Block a user