mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
scanner: Also fail when an implicitly versioned message is out of order
Fail if a message with version implicitly set to 1 (i.e. not specified) comes after a message with since-version > 1. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
3ed76204a9
commit
99a72777f9
1 changed files with 6 additions and 4 deletions
|
|
@ -404,12 +404,14 @@ start_element(void *data, const char *element_name, const char **atts)
|
||||||
if (errno == EINVAL || end == since || *end != '\0')
|
if (errno == EINVAL || end == since || *end != '\0')
|
||||||
fail(&ctx->loc,
|
fail(&ctx->loc,
|
||||||
"invalid integer (%s)\n", since);
|
"invalid integer (%s)\n", since);
|
||||||
if (version < ctx->interface->since)
|
} else {
|
||||||
fail(&ctx->loc, "since version not increasing\n");
|
version = 1;
|
||||||
ctx->interface->since = version;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message->since = ctx->interface->since;
|
if (version < ctx->interface->since)
|
||||||
|
fail(&ctx->loc, "since version not increasing\n");
|
||||||
|
ctx->interface->since = version;
|
||||||
|
message->since = version;
|
||||||
|
|
||||||
if (strcmp(name, "destroy") == 0 && !message->destructor)
|
if (strcmp(name, "destroy") == 0 && !message->destructor)
|
||||||
fail(&ctx->loc, "destroy request should be destructor type");
|
fail(&ctx->loc, "destroy request should be destructor type");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue