]> git.kaiwu.me - njs.git/commitdiff
Fixed alignment of njs_object_prop_t in njs_method_private_copy().
authorValentin Bartenev <vbart@nginx.com>
Mon, 6 May 2019 14:47:26 +0000 (17:47 +0300)
committerValentin Bartenev <vbart@nginx.com>
Mon, 6 May 2019 14:47:26 +0000 (17:47 +0300)
It must be aligned to njs_value_t.

njs/njs_object.c

index 288804389dc4ec3cd74709e4ceaa51db217159f2..87c50d7f499e80e603b1d7b923d29b5bf77e4ecb 100644 (file)
@@ -773,7 +773,8 @@ njs_method_private_copy(njs_vm_t *vm, njs_property_query_t *pq)
     njs_function_t     *function;
     njs_object_prop_t  *prop, *shared;
 
-    prop = nxt_mp_alloc(vm->mem_pool, sizeof(njs_object_prop_t));
+    prop = nxt_mp_align(vm->mem_pool, sizeof(njs_value_t),
+                        sizeof(njs_object_prop_t));
     if (nxt_slow_path(prop == NULL)) {
         njs_memory_error(vm);
         return NXT_ERROR;