mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
tnode_t::try_get_child() to properly implement null check.
try_get_child() was taking the address of a reference; clang was thereby assuming it could not be null and so was dropping the null check. Ensure we do not dereference a null pointer. Fixes #4678
This commit is contained in:
parent
c92bb703dc
commit
5b3729842c
1 changed files with 1 additions and 1 deletions
|
@ -143,7 +143,7 @@ class tnode_t {
|
|||
static_assert(child_type_possible_at_index<Type, ChildType, Index>(),
|
||||
"Cannot contain a child of this type");
|
||||
const parse_node_t *child = nullptr;
|
||||
if (nodeptr) child = &get_child_node<Index>();
|
||||
if (nodeptr) child = tree->get_child(*nodeptr, Index);
|
||||
if (child && child->type == ChildType::token) return {tree, child};
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue