summaryrefslogtreecommitdiff
path: root/tools/perf/util/expr.y
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2020-08-26 08:30:55 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-11-16 14:09:18 -0300
commit29396cd573da08ae9ab0b75925c2f6b3cabb9dfa (patch)
tree49d6b307007eb1a1ecccc2721bfb13607785bb10 /tools/perf/util/expr.y
parent3d05181a085c7a070746c838ea25aebf25f17d52 (diff)
perf expr: Force encapsulation on expr_id_data
This patch resolves some undefined behavior where variables in expr_id_data were accessed (for debugging) without being defined. To better enforce the tagged union behavior, the struct is moved into expr.c and accessors provided. Tag values (kinds) are explicitly identified. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-By: Kajol Jain<kjain@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@redhat.com> Link: https://lore.kernel.org/r/20200826153055.2067780-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/expr.y')
-rw-r--r--tools/perf/util/expr.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/expr.y b/tools/perf/util/expr.y
index d34b370391c6..b2ada8f8309a 100644
--- a/tools/perf/util/expr.y
+++ b/tools/perf/util/expr.y
@@ -93,7 +93,7 @@ expr: NUMBER
YYABORT;
}
- $$ = data->val;
+ $$ = expr_id_data__value(data);
free($1);
}
| expr '|' expr { $$ = (long)$1 | (long)$3; }