Skip to content

Commit 7e042a8

Browse files
authored
Merge pull request #3787 from stevenjohnstone/bug/3768
Avoid undefined int overflow behaviour
2 parents 88b57ef + b72b664 commit 7e042a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/src/serialize.c.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer)
315315
// buffer offset. We will add a leading 1 to indicate that this
316316
// is a buffer offset.
317317
uint32_t content_offset = pm_sizet_to_u32(buffer->length);
318-
uint32_t owned_mask = (uint32_t) (1 << 31);
318+
uint32_t owned_mask = 1U << 31;
319319

320320
assert(content_offset < owned_mask);
321321
content_offset |= owned_mask;

0 commit comments

Comments
 (0)