[njs] Avoiding modification of vm->retval in njs_promise_alloc().

Dmitry Volyntsev xeioex at nginx.com
Wed Dec 16 20:28:46 UTC 2020


details:   https://hg.nginx.org/njs/rev/1f862b9dec16
branches:  
changeset: 1582:1f862b9dec16
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Dec 16 20:27:31 2020 +0000
description:
Avoiding modification of vm->retval in njs_promise_alloc().

Alloc functions are not expected to modify existing values.

diffstat:

 src/njs_promise.c |  1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diffs (11 lines):

diff -r 4f5feafc1afc -r 1f862b9dec16 src/njs_promise.c
--- a/src/njs_promise.c	Wed Dec 16 20:27:27 2020 +0000
+++ b/src/njs_promise.c	Wed Dec 16 20:27:31 2020 +0000
@@ -107,7 +107,6 @@ njs_promise_alloc(njs_vm_t *vm)
     njs_queue_init(&data->fulfill_queue);
     njs_queue_init(&data->reject_queue);
 
-    njs_set_promise(&vm->retval, promise);
     njs_set_data(&promise->value, data, 0);
 
     return promise;


More information about the nginx-devel mailing list