From b72b664675097d4474135f162924644f109ff5c7 Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Fri, 5 Dec 2025 17:44:00 +0000 Subject: [PATCH] Avoid undefined int overflow behaviour Fixes #3786. --- templates/src/serialize.c.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/src/serialize.c.erb b/templates/src/serialize.c.erb index 3e15a11039..0f0aace445 100644 --- a/templates/src/serialize.c.erb +++ b/templates/src/serialize.c.erb @@ -315,7 +315,7 @@ pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer) // buffer offset. We will add a leading 1 to indicate that this // is a buffer offset. uint32_t content_offset = pm_sizet_to_u32(buffer->length); - uint32_t owned_mask = (uint32_t) (1 << 31); + uint32_t owned_mask = 1U << 31; assert(content_offset < owned_mask); content_offset |= owned_mask;