* Problem report #89
@ 2006-07-17 18:00 Dan Nicolaescu
2006-07-17 18:57 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2006-07-17 18:00 UTC (permalink / raw)
CID: 89
Checker: UNINIT (help)
File: base/src/emacs/src/eval.c
Function: Feval
Description: Using uninitialized value "val"
2113 DEFUN ("eval", Feval, Seval, 1, 1, 0,
2114 doc: /* Evaluate FORM and return its value. */)
2115 (form)
2116 Lisp_Object form;
2117 {
Event var_decl: Declared variable "val" without initializer
Also see events: [uninit_use]
2118 Lisp_Object fun, val, original_fun, original_args;
2119 Lisp_Object funcar;
2120 struct backtrace backtrace;
2121 struct gcpro gcpro1, gcpro2, gcpro3;
2122
2123 if (handling_signal)
2124 abort ();
2125
2126 if (SYMBOLP (form))
2127 return Fsymbol_value (form);
2128 if (!CONSP (form))
2129 return form;
2130
2131 QUIT;
2132 if ((consing_since_gc > gc_cons_threshold
2133 && consing_since_gc > gc_relative_threshold)
2134 ||
2135 (!NILP (Vmemory_full) && consing_since_gc > memory_full_cons_threshold))
2136 {
2137 GCPRO1 (form);
2138 Fgarbage_collect ();
2139 UNGCPRO;
2140 }
2141
2142 if (++lisp_eval_depth > max_lisp_eval_depth)
2143 {
2144 if (max_lisp_eval_depth < 100)
2145 max_lisp_eval_depth = 100;
2146 if (lisp_eval_depth > max_lisp_eval_depth)
2147 error ("Lisp nesting exceeds `max-lisp-eval-depth'");
2148 }
2149
2150 original_fun = Fcar (form);
2151 original_args = Fcdr (form);
2152
2153 backtrace.next = backtrace_list;
2154 backtrace_list = &backtrace;
2155 backtrace.function = &original_fun; /* This also protects them from gc */
2156 backtrace.args = &original_args;
2157 backtrace.nargs = UNEVALLED;
2158 backtrace.evalargs = 1;
2159 backtrace.debug_on_exit = 0;
2160
2161 if (debug_on_next_call)
2162 do_debug_on_call (Qt);
2163
2164 /* At this point, only original_fun and original_args
2165 have values that will be used below */
2166 retry:
2167
2168 /* Optimize for no indirection. */
2169 fun = original_fun;
At conditional (8): "fun & 7 == 1" taking true path
At conditional (9): "fun != Qunbound" taking true path
At conditional (10): "(fun = ((0), (fun & -8))->function), (fun & 7 == 1)" taking true path
2170 if (SYMBOLP (fun) && !EQ (fun, Qunbound)
2171 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2172 fun = indirect_function (fun);
2173
At conditional (1): "((0), (fun & -8))->size & 1073758208 == 1073758208" taking false path
At conditional (11): "fun & 7 == 4" taking true path
At conditional (12): "((0), (fun & -8))->size & 1073758208 == 1073758208" taking false path
2174 if (SUBRP (fun))
2175 {
2176 Lisp_Object numargs;
2177 Lisp_Object argvals[8];
2178 Lisp_Object args_left;
2179 register int i, maxargs;
2180
2181 args_left = original_args;
2182 numargs = Flength (args_left);
2183
2184 CHECK_CONS_LIST ();
2185
2186 if (XINT (numargs) < XSUBR (fun)->min_args ||
2187 (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < XINT (numargs)))
2188 Fsignal (Qwrong_number_of_arguments, list2 (original_fun, numargs));
2189
2190 if (XSUBR (fun)->max_args == UNEVALLED)
2191 {
2192 backtrace.evalargs = 0;
2193 val = (*XSUBR (fun)->function) (args_left);
2194 goto done;
2195 }
2196
2197 if (XSUBR (fun)->max_args == MANY)
2198 {
2199 /* Pass a vector of evaluated arguments */
2200 Lisp_Object *vals;
2201 register int argnum = 0;
2202
2203 vals = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object));
2204
2205 GCPRO3 (args_left, fun, fun);
2206 gcpro3.var = vals;
2207 gcpro3.nvars = 0;
2208
2209 while (!NILP (args_left))
2210 {
2211 vals[argnum++] = Feval (Fcar (args_left));
2212 args_left = Fcdr (args_left);
2213 gcpro3.nvars = argnum;
2214 }
2215
2216 backtrace.args = vals;
2217 backtrace.nargs = XINT (numargs);
2218
2219 val = (*XSUBR (fun)->function) (XINT (numargs), vals);
2220 UNGCPRO;
2221 goto done;
2222 }
2223
2224 GCPRO3 (args_left, fun, fun);
2225 gcpro3.var = argvals;
2226 gcpro3.nvars = 0;
2227
2228 maxargs = XSUBR (fun)->max_args;
2229 for (i = 0; i < maxargs; args_left = Fcdr (args_left))
2230 {
2231 argvals[i] = Feval (Fcar (args_left));
2232 gcpro3.nvars = ++i;
2233 }
2234
2235 UNGCPRO;
2236
2237 backtrace.args = argvals;
2238 backtrace.nargs = XINT (numargs);
2239
2240 switch (i)
2241 {
2242 case 0:
2243 val = (*XSUBR (fun)->function) ();
2244 goto done;
2245 case 1:
2246 val = (*XSUBR (fun)->function) (argvals[0]);
2247 goto done;
2248 case 2:
2249 val = (*XSUBR (fun)->function) (argvals[0], argvals[1]);
2250 goto done;
2251 case 3:
2252 val = (*XSUBR (fun)->function) (argvals[0], argvals[1],
2253 argvals[2]);
2254 goto done;
2255 case 4:
2256 val = (*XSUBR (fun)->function) (argvals[0], argvals[1],
2257 argvals[2], argvals[3]);
2258 goto done;
2259 case 5:
2260 val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
2261 argvals[3], argvals[4]);
2262 goto done;
2263 case 6:
2264 val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
2265 argvals[3], argvals[4], argvals[5]);
2266 goto done;
2267 case 7:
2268 val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
2269 argvals[3], argvals[4], argvals[5],
2270 argvals[6]);
2271 goto done;
2272
2273 case 8:
2274 val = (*XSUBR (fun)->function) (argvals[0], argvals[1], argvals[2],
2275 argvals[3], argvals[4], argvals[5],
2276 argvals[6], argvals[7]);
2277 goto done;
2278
2279 default:
2280 /* Someone has created a subr that takes more arguments than
2281 is supported by this code. We need to either rewrite the
2282 subr to use a different argument protocol, or add more
2283 cases to this switch. */
2284 abort ();
2285 }
2286 }
At conditional (2): "fun & 7 == 4" taking true path
At conditional (3): "((0), (fun & -8))->size & 1073743872 == 1073743872" taking false path
At conditional (13): "fun & 7 == 4" taking true path
At conditional (14): "((0), (fun & -8))->size & 1073743872 == 1073743872" taking false path
2287 if (COMPILEDP (fun))
2288 val = apply_lambda (fun, original_args, 1);
2289 else
2290 {
At conditional (4): "fun == Qunbound" taking true path
At conditional (15): "fun == Qunbound" taking true path
2291 if (EQ (fun, Qunbound))
2292 Fsignal (Qvoid_function, Fcons (original_fun, Qnil));
At conditional (5): "fun & 7 != 5" taking true path
At conditional (16): "fun & 7 != 5" taking true path
2293 if (!CONSP (fun))
2294 Fsignal (Qinvalid_function, Fcons (original_fun, Qnil));
2295 funcar = Fcar (fun);
At conditional (6): "funcar & 7 != 1" taking true path
At conditional (17): "funcar & 7 != 1" taking true path
2296 if (!SYMBOLP (funcar))
2297 Fsignal (Qinvalid_function, Fcons (original_fun, Qnil));
At conditional (7): "funcar == Qautoload" taking true path
At conditional (18): "funcar == Qautoload" taking false path
2298 if (EQ (funcar, Qautoload))
2299 {
2300 do_autoload (fun, original_fun);
2301 goto retry;
2302 }
At conditional (19): "funcar == Qmacro" taking false path
2303 if (EQ (funcar, Qmacro))
2304 val = Feval (apply1 (Fcdr (fun), original_args));
At conditional (20): "funcar == Qlambda" taking false path
2305 else if (EQ (funcar, Qlambda))
2306 val = apply_lambda (fun, original_args, 1);
2307 else
2308 Fsignal (Qinvalid_function, Fcons (original_fun, Qnil));
2309 }
2310 done:
2311 CHECK_CONS_LIST ();
2312
2313 lisp_eval_depth--;
At conditional (21): "(backtrace).debug_on_exit != 0" taking false path
2314 if (backtrace.debug_on_exit)
2315 val = call_debugger (Fcons (Qexit, Fcons (val, Qnil)));
2316 backtrace_list = backtrace.next;
2317
Event uninit_use: Using uninitialized value "val"
Also see events: [var_decl]
2318 return val;
2319 }
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem report #89
2006-07-17 18:00 Problem report #89 Dan Nicolaescu
@ 2006-07-17 18:57 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2006-07-17 18:57 UTC (permalink / raw)
Dan Nicolaescu <dann@ics.uci.edu> writes:
> CID: 89
> Checker: UNINIT (help)
> File: base/src/emacs/src/eval.c
> Function: Feval
> Description: Using uninitialized value "val"
Same as #90.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-07-17 18:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-17 18:00 Problem report #89 Dan Nicolaescu
2006-07-17 18:57 ` Andreas Schwab
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.