From 3fa89baee0f2e5170ebb2262318bb05bc97d5c1b Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Tue, 3 Jan 2017 17:59:52 +0100 Subject: [PATCH] Reduce scope of variable in JS lexer (#1509) JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- jerry-core/parser/js/js-lexer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jerry-core/parser/js/js-lexer.c b/jerry-core/parser/js/js-lexer.c index 3c0401657..186fea9db 100644 --- a/jerry-core/parser/js/js-lexer.c +++ b/jerry-core/parser/js/js-lexer.c @@ -1228,7 +1228,6 @@ lexer_construct_literal_object (parser_context_t *context_p, /**< context */ uint8_t literal_type) /**< final literal type */ { uint8_t *destination_start_p; - uint8_t *destination_p; const uint8_t *source_p; uint8_t local_byte_array[LEXER_MAX_LITERAL_LOCAL_BUFFER_SIZE]; @@ -1241,6 +1240,8 @@ lexer_construct_literal_object (parser_context_t *context_p, /**< context */ if (literal_p->has_escape) { + uint8_t *destination_p; + if (literal_p->length > LEXER_MAX_LITERAL_LOCAL_BUFFER_SIZE) { destination_start_p = (uint8_t *) parser_malloc_local (context_p, literal_p->length);