jerry_init: Calculate structure part address more safely. (#3545)
GCC 9.2 issues a warning-as-error trying to perform a large memset into what it thinks as a single field of a structure. So, instead of taking an address of that field, perform explicit address calculaton using structure address and offset of that field. Fixes #3544. JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
This commit is contained in:
@@ -245,6 +245,7 @@ struct jerry_context_t
|
||||
* This part is for JerryScript which uses external context.
|
||||
*/
|
||||
|
||||
#define JERRY_CONTEXT_STRUCT (*jerry_port_get_current_context ())
|
||||
#define JERRY_CONTEXT(field) (jerry_port_get_current_context ()->field)
|
||||
|
||||
#if !ENABLED (JERRY_SYSTEM_ALLOCATOR)
|
||||
@@ -274,6 +275,11 @@ struct jmem_heap_t
|
||||
*/
|
||||
extern jerry_context_t jerry_global_context;
|
||||
|
||||
/**
|
||||
* Config-independent name for context.
|
||||
*/
|
||||
#define JERRY_CONTEXT_STRUCT (jerry_global_context)
|
||||
|
||||
/**
|
||||
* Provides a reference to a field in the current context.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user