]> git.kaiwu.me - njs.git/commitdiff
Parser: fixed function scope checks
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 23 May 2026 01:36:33 +0000 (18:36 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 26 May 2026 21:45:24 +0000 (14:45 -0700)
src/njs_variable.c

index b65e5934980a2b20740c4a0125b362708cf76a81..7fcaed46272acb51d3066258fa69b2b21fc3e2d2 100644 (file)
@@ -58,7 +58,7 @@ njs_variable_function_add(njs_parser_t *parser, njs_parser_scope_t *scope,
     }
 
     root = njs_function_scope(scope);
-    if (njs_slow_path(scope == NULL)) {
+    if (njs_slow_path(root == NULL)) {
         return NULL;
     }
 
@@ -275,7 +275,7 @@ njs_variable_scope_add(njs_parser_t *parser, njs_parser_scope_t *scope,
 
     if (index == NJS_INDEX_NONE) {
         root = njs_function_scope(scope);
-        if (njs_slow_path(scope == NULL)) {
+        if (njs_slow_path(root == NULL)) {
             return NULL;
         }