Skip to content

Commit abc9d59

Browse files
committed
printer context BUGFIX missing mem alignment
Refs #2455
1 parent 5a7e94a commit abc9d59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ ly_ctx_compiled_print(const struct ly_ctx *ctx, void *mem, void **mem_end)
14591459

14601460
/* context, referenced */
14611461
pctx = mem;
1462-
mem = (char *)mem + sizeof *pctx;
1462+
mem = (char *)mem + LY_CTXP_MEM_SIZE(sizeof *pctx);
14631463
ly_ctx_compiled_addr_ht_add(addr_ht, ctx, pctx);
14641464

14651465
/* members */

src/printer_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @return Size of @p ARRAY.
3434
*/
3535
#define CTXS_SIZED_ARRAY(ARRAY) \
36-
(ARRAY ? sizeof(LY_ARRAY_COUNT_TYPE) : 0) + LY_ARRAY_COUNT(ARRAY) * sizeof *ARRAY
36+
(ARRAY ? LY_CTXP_MEM_SIZE(sizeof(LY_ARRAY_COUNT_TYPE)) : 0) + LY_CTXP_MEM_SIZE(LY_ARRAY_COUNT(ARRAY) * sizeof *ARRAY)
3737

3838
/**
3939
* @brief Print (serialize) a sized array.

0 commit comments

Comments
 (0)