From 7d4569a6ffc05e5027446f82a61d54adba633153 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Fri, 19 Jun 2015 16:54:22 +0300 Subject: [PATCH] Fix valgrind false-positive warning in mem_heap_get_chunked_block_start. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com --- jerry-core/mem/mem-heap.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jerry-core/mem/mem-heap.cpp b/jerry-core/mem/mem-heap.cpp index 3fc35bc513..4fcbb295a2 100644 --- a/jerry-core/mem/mem-heap.cpp +++ b/jerry-core/mem/mem-heap.cpp @@ -902,9 +902,12 @@ mem_heap_get_chunked_block_start (void *ptr) /**< pointer into a block */ JERRY_ASSERT (uintptr > uintptr_chunk_aligned); mem_block_header_t *block_p = (mem_block_header_t *) uintptr_chunk_aligned; - JERRY_ASSERT (block_p->length_type == mem_block_length_type_t::ONE_CHUNKED); #ifndef JERRY_NDEBUG + VALGRIND_DEFINED_STRUCT (block_p); + JERRY_ASSERT (block_p->length_type == mem_block_length_type_t::ONE_CHUNKED); + VALGRIND_NOACCESS_STRUCT (block_p); + const mem_block_header_t *block_iter_p = mem_heap.first_block_p; bool is_found = false;