Welcome! Log In Create A New Profile

Advanced

[njs] Fixed import segfault.

Dmitry Volyntsev
December 25, 2019 10:26AM
details: https://hg.nginx.org/njs/rev/0f31637138ce
branches:
changeset: 1290:0f31637138ce
user: hongzhidao <hongzhidao@gmail.com>
date: Fri Dec 13 12:47:37 2019 +0800
description:
Fixed import segfault.

This closes #274 issue on Github.

diffstat:

src/njs_module.c | 1 +
test/module/lib1.js | 6 ++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 1c3c593cc3fd -r 0f31637138ce src/njs_module.c
--- a/src/njs_module.c Wed Dec 25 15:59:01 2019 +0300
+++ b/src/njs_module.c Fri Dec 13 12:47:37 2019 +0800
@@ -175,6 +175,7 @@ njs_parser_module(njs_vm_t *vm, njs_pars
goto fail;
}

+ module->function.args_offset = 1;
module->function.u.lambda = parser->node->u.value.data.u.lambda;

njs_mp_free(vm->mem_pool, text.start);
diff -r 1c3c593cc3fd -r 0f31637138ce test/module/lib1.js
--- a/test/module/lib1.js Wed Dec 25 15:59:01 2019 +0300
+++ b/test/module/lib1.js Fri Dec 13 12:47:37 2019 +0800
@@ -1,3 +1,9 @@
+var foo = (function(){
+ return (function f() {})
+});
+
+foo()({1:[]})
+
function hash() {
var h = crypto.createHash('md5');
var v = h.update('AB').digest('hex');
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed import segfault.

Dmitry Volyntsev 364 December 25, 2019 10:26AM



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

Online Users

Guests: 225
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready