Re: Uninitialized variable in VIS 1.4 distribution?

From: Fabio Somenzi (Fabio@colorado.edu)
Date: Wed May 22 2002 - 08:08:22 MDT

  • Next message: mmcald@tin.it: "SIS compilation"

    Dave,

    VIS does not use mdd_bundle_variables, so we haven't paid much
    attention to it. At first glance, it looks like

             new_var.mvar_id = var_i.mvar_id;

    should read

             new_var.mvar_id = array_n(mvar_list);

    I'm no expert of the mdd package, so I'll need to probe a bit further.
    Thanks for pointing this out.

    Fabio

    >>>>> "WD" == Wallace, David <david_wallace@mentorg.com> writes:

     WD> In the VIS 1.4 distribution, the function mdd_bundle_variables
     WD> (in mdd_bund.c in the mdd directory of the glu-1.4 files) starts off:

     WD> #include "mdd.h"

     WD> int
     WD> mdd_bundle_variables( mgr, bundle_vars, mdd_var_name, mdd_id )
     WD> mdd_manager *mgr;
     WD> array_t *bundle_vars;
     WD> char *mdd_var_name;
     WD> int *mdd_id;
     WD> {
     WD> array_t *mvar_list, *bvar_list;
     WD> mvar_type var_i, new_var;
     WD> int i, var_i_id;
     WD> bvar_type *bit_i_ptr;
            
     WD> mvar_list = mdd_ret_mvar_list(mgr);
     WD> bvar_list = mdd_ret_bvar_list(mgr);

     WD> new_var.mvar_id = var_i.mvar_id;

     WD> That last assignment involves an uninitialized variable read,
     WD> since var_i is an automatic variable that has never been initialized.
     WD> Is this a typo? How should this read?

     WD> Dave W.



    This archive was generated by hypermail 2b30 : Wed May 22 2002 - 08:16:50 MDT