From: Olivier Dion Date: Thu, 24 Oct 2024 15:09:25 +0000 (-0400) Subject: Don't abort on unknown type label X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=d31a06f8aa347e802f77aab7b11b7cfeb46b8933;p=libside.git 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 --- 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 ""; } }