[njs] Removed dead code in njs_value_property_set() after df385232d2af.

Dmitry Volyntsev xeioex at nginx.com
Wed Aug 7 12:37:23 UTC 2019


details:   https://hg.nginx.org/njs/rev/90b8adf370d4
branches:  
changeset: 1112:90b8adf370d4
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Aug 07 15:17:57 2019 +0300
description:
Removed dead code in njs_value_property_set() after df385232d2af.

Found by Coverity Scan (CID 1452240).

diffstat:

 src/njs_value.c |  9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diffs (33 lines):

diff -r 30b1199acaaf -r 90b8adf370d4 src/njs_value.c
--- a/src/njs_value.c	Tue Aug 06 19:45:23 2019 +0300
+++ b/src/njs_value.c	Wed Aug 07 15:17:57 2019 +0300
@@ -1056,7 +1056,7 @@ njs_value_property_set(njs_vm_t *vm, njs
     njs_value_t *setval)
 {
     njs_int_t             ret;
-    njs_object_prop_t     *prop, *shared;
+    njs_object_prop_t     *prop;
     njs_property_query_t  pq;
 
     if (njs_is_primitive(value)) {
@@ -1065,8 +1065,6 @@ njs_value_property_set(njs_vm_t *vm, njs
         return NJS_ERROR;
     }
 
-    shared = NULL;
-
     njs_property_query_init(&pq, NJS_PROPERTY_QUERY_SET, 0);
 
     ret = njs_property_query(vm, &pq, value, key);
@@ -1158,11 +1156,6 @@ njs_value_property_set(njs_vm_t *vm, njs
         return NJS_ERROR;
     }
 
-    if (njs_slow_path(shared != NULL)) {
-        prop->enumerable = shared->enumerable;
-        prop->configurable = shared->configurable;
-    }
-
     pq.lhq.replace = 0;
     pq.lhq.value = prop;
     pq.lhq.pool = vm->mem_pool;


More information about the nginx-devel mailing list