From 07c86ece5428f9734460b6805c7e04db8b0f9923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Borb=C3=A9ly?= Date: Mon, 24 Apr 2017 13:02:14 +0200 Subject: [PATCH] Fix alignment in case of enabled 32bit compressed pointers (#1764) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com --- jerry-core/parser/js/byte-code.c | 6 ++++++ jerry-core/parser/js/byte-code.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/jerry-core/parser/js/byte-code.c b/jerry-core/parser/js/byte-code.c index 386415d44..9ee17b7ad 100644 --- a/jerry-core/parser/js/byte-code.c +++ b/jerry-core/parser/js/byte-code.c @@ -15,6 +15,12 @@ #include "js-parser-internal.h" +JERRY_STATIC_ASSERT ((sizeof (cbc_uint8_arguments_t) % sizeof (jmem_cpointer_t)) == 0, + sizeof_cbc_uint8_arguments_t_must_be_divisible_by_sizeof_jmem_cpointer_t); + +JERRY_STATIC_ASSERT ((sizeof (cbc_uint16_arguments_t) % sizeof (jmem_cpointer_t)) == 0, + sizeof_cbc_uint16_arguments_t_must_be_divisible_by_sizeof_jmem_cpointer_t); + #if JERRY_JS_PARSER /** \addtogroup parser Parser diff --git a/jerry-core/parser/js/byte-code.h b/jerry-core/parser/js/byte-code.h index 3494ae641..0eb3522cf 100644 --- a/jerry-core/parser/js/byte-code.h +++ b/jerry-core/parser/js/byte-code.h @@ -637,6 +637,9 @@ typedef struct uint16_t ident_end; /**< end position of the identifier group */ uint16_t const_literal_end; /**< end position of the const literal group */ uint16_t literal_end; /**< end position of the literal group */ +#ifdef JERRY_CPOINTER_32_BIT + uint16_t padding; /**< an unused value */ +#endif } cbc_uint16_arguments_t; /**