egcs, possible c++/g++ bug, accessing uninitialized var + PATCH
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Mon Sep 28 06:44:00 GMT 1998
Jason,
In tracking down one warning about an uninitialized variable,
it appeared that this one clearly was getting accessed before being
set. Without knowing the code in question, it still seemed reasonable
to make the following changes. Would you please take a look and
let me know if its okay to install?
Thanks,
--Kaveh
Sun Sep 27 20:58:43 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* call.c (build_object_call): Move declaration of variable
`fn' into the scope where it is used. Don't access variable
`fn' when it is uninitialized, instead use `fns'.
diff -rup orig/egcs-CVS19980927/gcc/cp/call.c egcs-CVS19980927/gcc/cp/call.c
--- orig/egcs-CVS19980927/gcc/cp/call.c Sun Sep 27 18:25:40 1998
+++ egcs-CVS19980927/gcc/cp/call.c Sun Sep 27 21:08:24 1998
@@ -2394,13 +2394,12 @@ build_object_call (obj, args)
{
tree fns = TREE_VALUE (convs);
tree totype = TREE_TYPE (TREE_TYPE (OVL_CURRENT (fns)));
- tree fn;
if (TREE_CODE (totype) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (totype)) == FUNCTION_TYPE)
- for (; fns; fns = OVL_NEXT (fn))
+ for (; fns; fns = OVL_NEXT (fns))
{
- fn = OVL_CURRENT (fn);
+ tree fn = OVL_CURRENT (fns);
if (TREE_CODE (fn) == TEMPLATE_DECL)
{
templates = scratch_tree_cons (NULL_TREE, fn, templates);
More information about the Gcc-bugs
mailing list