Bug Summary

File:build/Linux-monkey/duktape/dom_settable_token_list.c
Warning:line 130, column 5
Value stored to 'exc' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name dom_settable_token_list.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/var/lib/jenkins/workspace/scan-build-netsurf -resource-dir /usr/lib/llvm-14/lib/clang/14.0.6 -I . -I include -I build/Linux-monkey -I frontends -I content/handlers -D WITH_JPEG -U WITH_PDF_EXPORT -D LIBICONV_PLUG -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -I /usr/include/x86_64-linux-gnu -D WITH_CURL -D WITH_OPENSSL -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -D UTF8PROC_EXPORTS -D WITH_UTF8PROC -D WITH_WEBP -I /usr/include/libpng16 -D WITH_PNG -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include/ -D WITH_BMP -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -D WITH_GIF -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -D WITH_NSPSL -I /var/lib/jenkins/artifacts-x86_64-linux-gnu/include -D WITH_NSLOG -D NETSURF_UA_FORMAT_STRING="Mozilla/5.0 (%s) NetSurf/%d.%d" -D NETSURF_HOMEPAGE="about:welcome" -D NETSURF_LOG_LEVEL=VERBOSE -D NETSURF_BUILTIN_LOG_FILTER="(level:WARNING || cat:jserrors)" -D NETSURF_BUILTIN_VERBOSE_FILTER="(level:VERBOSE || cat:jserrors)" -D STMTEXPR=1 -D monkey -D nsmonkey -D MONKEY_RESPATH="/var/lib/jenkins/artifacts-x86_64-linux-gnu/share/netsurf/" -D _POSIX_C_SOURCE=200809L -D _XOPEN_SOURCE=700 -D _BSD_SOURCE -D _DEFAULT_SOURCE -D _NETBSD_SOURCE -D DUK_OPT_HAVE_CUSTOM_H -internal-isystem /usr/lib/llvm-14/lib/clang/14.0.6/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wwrite-strings -Wno-unused-parameter -Wno-unused-but-set-variable -std=c99 -fconst-strings -fdebug-compilation-dir=/var/lib/jenkins/workspace/scan-build-netsurf -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-display-progress -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /var/lib/jenkins/workspace/scan-build-netsurf/clangScanBuildReports/2024-09-27-095240-3006188-1 -x c build/Linux-monkey/duktape/dom_settable_token_list.c
1/* Generated by nsgenbind
2 *
3 * nsgenbind is published under the MIT Licence.
4 * nsgenbind is similar to a compiler is a purely transformative tool which
5 * explicitly makes no copyright claim on this generated output
6 */
7
8/* DukTape JavaScript bindings for NetSurf browser
9 *
10 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
11 * This file is part of NetSurf, http://www.netsurf-browser.org/
12 * Released under the terms of the MIT License,
13 * http://www.opensource.org/licenses/mit-license
14 */
15
16#include <dom/dom.h>
17
18#include "utils/log.h"
19#include "utils/nsurl.h"
20
21#include "javascript/duktape/duktape.h"
22
23struct browser_window;
24struct html_content;
25struct dom_node;
26struct dom_element;
27struct dom_document;
28struct dom_html_element;
29struct dom_node_character_data;
30struct dom_node_text;
31struct dom_node_list;
32struct dom_node_comment;
33struct dom_html_collection;
34struct dom_html_br_element;
35
36
37#include "build/Linux-monkey/duktape/binding.h"
38#include "build/Linux-monkey/duktape/private.h"
39#include "build/Linux-monkey/duktape/prototype.h"
40
41#include "javascript/duktape/dukky.h"
42
43static void dukky_dom_settable_token_list___init(duk_context *ctx, dom_settable_token_list_private_t *priv, struct dom_tokenlist *tokens)
44{
45 dukky_dom_token_list___init(ctx, &priv->parent, tokens);
46#line 15 "DOMSettableTokenList.bnd"
47#line 48 "dom_settable_token_list.c"
48}
49
50static void dukky_dom_settable_token_list___fini(duk_context *ctx, dom_settable_token_list_private_t *priv)
51{
52 dukky_dom_token_list___fini(ctx, &priv->parent);
53}
54
55static duk_ret_t dukky_dom_settable_token_list___constructor(duk_context *ctx)
56{
57 /* create private data and attach to instance */
58 dom_settable_token_list_private_t *priv = calloc(1, sizeof(*priv));
59 if (priv == NULL((void*)0)) return 0;
60 duk_push_pointer(ctx, priv);
61 duk_put_prop_string(ctx, 0, dukky_magic_string_private);
62
63 dukky_dom_settable_token_list___init(ctx, priv, duk_get_pointer(ctx, 1));
64 duk_set_top(ctx, 1);
65 return 1;
66}
67
68static duk_ret_t dukky_dom_settable_token_list___destructor(duk_context *ctx)
69{
70 dom_settable_token_list_private_t *priv;
71 duk_get_prop_string(ctx, 0, dukky_magic_string_private);
72 priv = duk_get_pointer(ctx, -1);
73 duk_pop(ctx);
74 if (priv == NULL((void*)0)) return 0;
75
76 dukky_dom_settable_token_list___fini(ctx, priv);
77 free(priv);
78 return 0;
79}
80
81static duk_ret_t dukky_dom_settable_token_list_value_getter(duk_context *ctx)
82{
83 /* Get private data for method */
84 dom_settable_token_list_private_t *priv = NULL((void*)0);
85 duk_push_this(ctx);
86 duk_get_prop_string(ctx, -1, dukky_magic_string_private);
87 priv = duk_get_pointer(ctx, -1);
88 duk_pop_2(ctx);
89 if (priv == NULL((void*)0)) {
90 return 0; /* can do? No can do. */
91 }
92
93#line 17 "DOMSettableTokenList.bnd"
94
95 dom_exception exc;
96 dom_string *value;
97
98 exc = dom_tokenlist_get_value(priv->parent.tokens, &value);
99 if (exc != DOM_NO_ERR) return 0; /* coerced to undefined */
100
101 duk_push_lstring(ctx, dom_string_data(value), dom_string_length(value));
102 dom_string_unref(value);
103
104 return 1;
105#line 106 "dom_settable_token_list.c"
106}
107
108static duk_ret_t dukky_dom_settable_token_list_value_setter(duk_context *ctx)
109{
110 /* Get private data for method */
111 dom_settable_token_list_private_t *priv = NULL((void*)0);
112 duk_push_this(ctx);
113 duk_get_prop_string(ctx, -1, dukky_magic_string_private);
114 priv = duk_get_pointer(ctx, -1);
115 duk_pop_2(ctx);
116 if (priv == NULL((void*)0)) {
117 return 0; /* can do? No can do. */
118 }
119
120#line 31 "DOMSettableTokenList.bnd"
121
122 dom_exception exc;
123 dom_string *value;
124 duk_size_t slen;
125 const char *s = duk_require_lstring(ctx, 0, &slen);
126
127 exc = dom_string_create_interned((const uint8_t *)s, slen, &value);
128 if (exc != DOM_NO_ERR) return 0;
129
130 exc = dom_tokenlist_set_value(priv->parent.tokens, value);
Value stored to 'exc' is never read
131 dom_string_unref(value);
132
133 return 0;
134#line 135 "dom_settable_token_list.c"
135}
136
137duk_ret_t dukky_dom_settable_token_list___proto(duk_context *ctx, void *udata)
138{
139 /* Set this prototype's prototype (left-parent) */
140 /* get prototype */
141 duk_get_global_string(ctx, dukky_magic_string_prototypes);
142 duk_get_prop_string(ctx, -1, "\xFF\xFFNETSURF_DUKTAPE_PROTOTYPE_DOMTOKENLIST");
143 duk_replace(ctx, -2);
144 duk_set_prototype(ctx, 0);
145
146 /* Add read/write property */
147 duk_dup(ctx, 0);
148 duk_push_string(ctx, "value");
149 duk_push_c_function(ctx, dukky_dom_settable_token_list_value_getter, 0);
150 duk_push_c_function(ctx, dukky_dom_settable_token_list_value_setter, 1);
151 duk_def_prop(ctx, -4, DUK_DEFPROP_HAVE_GETTER(1U << 7) |
152 DUK_DEFPROP_HAVE_SETTER(1U << 8) |
153 DUK_DEFPROP_HAVE_ENUMERABLE(1U << 4) | DUK_DEFPROP_ENUMERABLE(1U << 1) |
154 DUK_DEFPROP_HAVE_CONFIGURABLE(1U << 5));
155 duk_pop(ctx);
156
157 /* Set the destructor */
158 duk_dup(ctx, 0);
159 duk_push_c_function(ctx, dukky_dom_settable_token_list___destructor, 1);
160 duk_set_finalizer(ctx, -2);
161 duk_pop(ctx);
162
163 /* Set the constructor */
164 duk_dup(ctx, 0);
165 duk_push_c_function(ctx, dukky_dom_settable_token_list___constructor, 2);
166 duk_put_prop_string(ctx, -2, "\xFF\xFFNETSURF_DUKTAPE_INIT");
167 duk_pop(ctx);
168
169 return 1; /* The prototype object */
170}
171
172