From 273c317d306cef68684e2e10648784eb0e47c02d Mon Sep 17 00:00:00 2001 From: mpi Date: Wed, 7 Feb 2024 19:07:42 +0000 Subject: [PATCH] Prevent tuples to be used as map key, associative array is what we want. --- usr.sbin/btrace/bt_parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/btrace/bt_parse.y b/usr.sbin/btrace/bt_parse.y index b378b89a0cf..b9feb008b8c 100644 --- a/usr.sbin/btrace/bt_parse.y +++ b/usr.sbin/btrace/bt_parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_parse.y,v 1.57 2024/01/16 14:35:56 claudio Exp $ */ +/* $OpenBSD: bt_parse.y,v 1.58 2024/02/07 19:07:42 mpi Exp $ */ /* * Copyright (c) 2019-2023 Martin Pieuchot @@ -611,6 +611,9 @@ bm_insert(const char *mname, struct bt_arg *mkey, struct bt_arg *mval) { struct bt_arg *ba; + if (mkey->ba_type == B_AT_TUPLE) + yyerror("tuple cannot be used as map key"); + ba = ba_new(bg_get(mname), B_AT_MAP); ba->ba_key = mkey; -- 2.20.1