Welcome! Log In Create A New Profile

Advanced

[njs] A fix of code generation of logical operations.

July 22, 2016 08:16AM
details: http://hg.nginx.org/njs/rev/41689f60372a
branches:
changeset: 129:41689f60372a
user: Igor Sysoev <igor@sysoev.ru>
date: Thu Jul 21 21:37:46 2016 +0300
description:
A fix of code generation of logical operations.

diffstat:

njs/njs_generator.c | 5 -----
njs/test/njs_unit_test.c | 3 +++
2 files changed, 3 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r f59ab0fccecb -r 41689f60372a njs/njs_generator.c
--- a/njs/njs_generator.c Thu Jul 21 20:51:22 2016 +0300
+++ b/njs/njs_generator.c Thu Jul 21 21:37:46 2016 +0300
@@ -1666,11 +1666,6 @@ njs_generate_test_jump_expression(njs_vm
test_jump->code.retval = NJS_VMCODE_RETVAL;
test_jump->value = node->left->index;

- ret = njs_generator_node_index_release(vm, parser, node->left);
- if (nxt_slow_path(ret != NXT_OK)) {
- return ret;
- }
-
node->index = njs_generator_dest_index(vm, parser, node);
if (nxt_slow_path(node->index == NJS_INDEX_ERROR)) {
return node->index;
diff -r f59ab0fccecb -r 41689f60372a njs/test/njs_unit_test.c
--- a/njs/test/njs_unit_test.c Thu Jul 21 20:51:22 2016 +0300
+++ b/njs/test/njs_unit_test.c Thu Jul 21 21:37:46 2016 +0300
@@ -1476,6 +1476,9 @@ static njs_unit_test_t njs_test[] =
{ nxt_string("var a = 3; if (true) if (false); else; a = 2; a"),
nxt_string("2") },

+ { nxt_string("var a = [3], b; if (1==1||2==2) { b = '1'+'2'+a[0] }; b }"),
+ nxt_string("123") },
+
/* do while. */

{ nxt_string("do { break } if (false)"),

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

[njs] A fix of code generation of logical operations.

Igor Sysoev 714 July 22, 2016 08:16AM



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

Online Users

Guests: 258
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