scanner: reject destructor type on event

Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
This commit is contained in:
YaoBing Xiao 2026-04-03 17:20:53 +08:00
parent e647f6304d
commit 6dd87030dc

View file

@ -840,6 +840,9 @@ start_element(void *data, const char *element_name, const char **atts)
if (strcmp(name, "destroy") == 0 && !message->destructor)
fail(&ctx->loc, "destroy request should be destructor type");
if (strcmp(element_name, "event") == 0 && message->destructor)
fail(&ctx->loc, "event cannot have type destructor");
ctx->message = message;
} else if (strcmp(element_name, "arg") == 0) {
if (name == NULL)