From cd6ff690d05fac41bd69996d1708d4cdc7537448 Mon Sep 17 00:00:00 2001 From: Roland Takacs Date: Tue, 9 Feb 2016 09:58:50 +0100 Subject: [PATCH] Add missing parentheses for bit operations where type cast is used. Fix for #853. These modifications are required by gcc 4.9 or above. JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com --- jerry-core/parser/js/js-lexer.cpp | 2 +- jerry-core/parser/js/js-parser.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jerry-core/parser/js/js-lexer.cpp b/jerry-core/parser/js/js-lexer.cpp index 3131fda88..52fbc9541 100644 --- a/jerry-core/parser/js/js-lexer.cpp +++ b/jerry-core/parser/js/js-lexer.cpp @@ -1767,7 +1767,7 @@ lexer_construct_regexp_object (parser_context_t *context_p, /**< context */ parser_raise_error (context_p, PARSER_ERR_DUPLICATED_REGEXP_FLAG); } - current_flags |= (uint16_t) flag; + current_flags = (uint16_t) (current_flags | flag); source_p++; column++; } diff --git a/jerry-core/parser/js/js-parser.cpp b/jerry-core/parser/js/js-parser.cpp index ba5de7ddc..84d2e363e 100644 --- a/jerry-core/parser/js/js-parser.cpp +++ b/jerry-core/parser/js/js-parser.cpp @@ -408,7 +408,7 @@ parser_encode_literal (uint8_t *dst_p, /**< destination buffer */ } else { - *dst_p++ = (uint8_t) (literal_index >> 8) | CBC_HIGHEST_BIT_MASK; + *dst_p++ = (uint8_t) ((literal_index >> 8) | CBC_HIGHEST_BIT_MASK); *dst_p++ = (uint8_t) (literal_index & CBC_MAXIMUM_BYTE_VALUE); } } @@ -1358,7 +1358,7 @@ parser_post_processing (parser_context_t *context_p) /**< context */ else { JERRY_ASSERT (literal_index <= CBC_MAXIMUM_FULL_VALUE); - *first_byte = (uint8_t) (literal_p->prop.index >> 8) | CBC_HIGHEST_BIT_MASK; + *first_byte = (uint8_t) ((literal_p->prop.index >> 8) | CBC_HIGHEST_BIT_MASK); page_p->bytes[offset] = (uint8_t) (literal_p->prop.index & 0xff); length++; }