Welcome! Log In Create A New Profile

Advanced

[njs] Fixed handling of "init" flag in njs_vm_create().

Dmitry Volyntsev
November 19, 2019 11:34AM
details: https://hg.nginx.org/njs/rev/452ce96df2e3
branches:
changeset: 1245:452ce96df2e3
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Tue Nov 19 19:19:53 2019 +0300
description:
Fixed handling of "init" flag in njs_vm_create().

diffstat:

src/njs_shell.c | 2 +-
src/njs_vm.c | 2 +-
src/test/njs_interactive_test.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r d4fdf0fc449d -r 452ce96df2e3 src/njs_shell.c
--- a/src/njs_shell.c Tue Nov 19 17:22:53 2019 +0300
+++ b/src/njs_shell.c Tue Nov 19 19:19:53 2019 +0300
@@ -243,7 +243,7 @@ main(int argc, char **argv)
vm_options.file.start = (u_char *) opts.file;
vm_options.file.length = njs_strlen(opts.file);

- vm_options.init = !opts.interactive;
+ vm_options.init = 1;
vm_options.accumulative = opts.interactive;
vm_options.disassemble = opts.disassemble;
vm_options.backtrace = 1;
diff -r d4fdf0fc449d -r 452ce96df2e3 src/njs_vm.c
--- a/src/njs_vm.c Tue Nov 19 17:22:53 2019 +0300
+++ b/src/njs_vm.c Tue Nov 19 19:19:53 2019 +0300
@@ -85,7 +85,7 @@ njs_vm_create(njs_vm_opt_t *options)
vm->debug = debug;
}

- if (options->accumulative) {
+ if (options->init) {
ret = njs_vm_init(vm);
if (njs_slow_path(ret != NJS_OK)) {
return NULL;
diff -r d4fdf0fc449d -r 452ce96df2e3 src/test/njs_interactive_test.c
--- a/src/test/njs_interactive_test.c Tue Nov 19 17:22:53 2019 +0300
+++ b/src/test/njs_interactive_test.c Tue Nov 19 19:19:53 2019 +0300
@@ -289,6 +289,7 @@ njs_interactive_test(njs_bool_t verbose)

njs_memzero(&options, sizeof(njs_vm_opt_t));

+ options.init = 1;
options.accumulative = 1;
options.backtrace = 1;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed handling of "init" flag in njs_vm_create().

Dmitry Volyntsev 108 November 19, 2019 11:34AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 80
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready