libtraceevent: Add support for nested ?: conditionals
PATCH 1/1 libtraceevent: Add support for nested ?: conditionals
From: "Steven Rostedt (Google)" <[email protected]>
It was reported that nested ?: conditionals were broken in libtraceevent. Specifically, the following did not parse correctly:
REC->severity == AER_CORRECTABLE ? "Corrected" : REC->severity == AER_FATAL ? "Fatal" : "Uncorrected, non-fatal",
That was due to the second half of the ':' operator was not being evaluated.
Reported-by Borislav Petkov <[email protected]>
Reported-by Sargun Dhillon <[email protected]>
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/event-parse.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
src/event-parse.c +10 -0
@@ -2083,6 +2083,16 @@ process_cond(struct tep_event *event, struct tep_print_arg *top, char **tok) type =process_arg (event, right, &token); + againagain: +if (type ==TEP_EVENT_ERROR ) + goto out_free; + +/* Handle other operations in the results */ +if (type ==TEP_EVENT_OP ) { + type =process_op (event, right, &token); + goto againagain; + } + top->op.right = arg; *tok = token;
Signature · 1 line
2.47.2