[njs] Fixed building by SunC.

Dmitry Volyntsev xeioex at nginx.com
Mon Feb 12 11:56:32 UTC 2018


details:   http://hg.nginx.org/njs/rev/700daa193d35
branches:  
changeset: 441:700daa193d35
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Feb 12 14:54:23 2018 +0300
description:
Fixed building by SunC.

diffstat:

 njs/njs_object.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r f3ed1e9fa8d2 -r 700daa193d35 njs/njs_object.c
--- a/njs/njs_object.c	Fri Feb 09 20:34:44 2018 +0300
+++ b/njs/njs_object.c	Mon Feb 12 14:54:23 2018 +0300
@@ -823,11 +823,13 @@ njs_object_seal(njs_vm_t *vm, njs_value_
 {
     nxt_lvlhsh_t       *hash;
     njs_object_t       *object;
+    const njs_value_t  *retval;
     njs_object_prop_t  *prop;
     nxt_lvlhsh_each_t  lhe;
 
     if (nargs < 2 || !njs_is_object(&args[1])) {
-        vm->retval = (nargs < 2) ? njs_value_void : args[1];
+        retval = (nargs < 2) ? &njs_value_void : &args[1];
+        vm->retval = *retval;
         return NXT_OK;
     }
 
@@ -906,8 +908,11 @@ static njs_ret_t
 njs_object_prevent_extensions(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
     njs_index_t unused)
 {
+    const njs_value_t  *retval;
+
     if (nargs < 2 || !njs_is_object(&args[1])) {
-        vm->retval = (nargs < 2) ? njs_value_void : args[1];
+        retval = (nargs < 2) ? &njs_value_void : &args[1];
+        vm->retval = *retval;
         return NXT_OK;
     }
 


More information about the nginx-devel mailing list