Skip to content

Commit

Permalink
walk: Fix crash when addressing expression as a node when it's not
Browse files Browse the repository at this point in the history
The expression might not be a node expression at this point, which
would lead to addressing an invalid node.

Fixes #122

Signed-off-by: Pantelis Antoniou <[email protected]>
  • Loading branch information
pantoniou committed Sep 30, 2024
1 parent 0bbe029 commit 659f1a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/fy-walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4487,7 +4487,7 @@ fy_walk_result_perform_set_op(struct fy_path_exec *fypx, struct fy_walk_result *

/* if this fails, it means we don't have any output */
if (fwrin->fyn == fwrrm->fyn ||
(relpath = fy_node_get_path_relative_to(fwrin->fyn, fwrrm->fyn)) == NULL)
(fwrrm->type == fwrt_node_ref && (relpath = fy_node_get_path_relative_to(fwrin->fyn, fwrrm->fyn)) == NULL))
continue;
#ifdef DEBUG_EXPR
fy_diag_diag(fypx->cfg.diag, FYDF_WARNING, "relpath: %s", relpath);
Expand Down

0 comments on commit 659f1a9

Please sign in to comment.