From d31a06f8aa347e802f77aab7b11b7cfeb46b8933 Mon Sep 17 00:00:00 2001 From: Olivier Dion Date: Thu, 24 Oct 2024 11:09:25 -0400 Subject: [PATCH] Don't abort on unknown type label When a mismatch is detected by the visitor, type label are converted to string to help debugging. On unknown label, instead of aborting during the error dump, return `'. Also added missing `SIDE_TYPE_OPTIONAL' case. Change-Id: Ia654c1a293c8a033a15aed3c9fe6473182cbc018 Signed-off-by: Olivier Dion Signed-off-by: Mathieu Desnoyers --- src/visit-arg-vec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/visit-arg-vec.c b/src/visit-arg-vec.c index 7b54d9a..4960ad3 100644 --- a/src/visit-arg-vec.c +++ b/src/visit-arg-vec.c @@ -1083,6 +1083,7 @@ const char *side_type_label_to_string(enum side_type_label label) case SIDE_TYPE_STRING_UTF32: return "SIDE_TYPE_STRING_UTF32"; case SIDE_TYPE_STRUCT: return "SIDE_TYPE_STRUCT"; case SIDE_TYPE_VARIANT: return "SIDE_TYPE_VARIANT"; + case SIDE_TYPE_OPTIONAL: return "SIDE_TYPE_OPTIONAL"; case SIDE_TYPE_ARRAY: return "SIDE_TYPE_ARRAY"; case SIDE_TYPE_VLA: return "SIDE_TYPE_VLA"; case SIDE_TYPE_VLA_VISITOR: return "SIDE_TYPE_VLA_VISITOR"; @@ -1111,7 +1112,7 @@ const char *side_type_label_to_string(enum side_type_label label) case SIDE_TYPE_DYNAMIC_VLA: return "SIDE_TYPE_DYNAMIC_VLA"; case SIDE_TYPE_DYNAMIC_VLA_VISITOR: return "SIDE_TYPE_DYNAMIC_VLA_VISITOR"; default: - abort(); + return ""; } } -- 2.34.1