Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Useless Assignment  at tdpro.c:1898

Categories: LANG.STRUCT.UA
Warning ID: 296.28973
Procedure: tm_mca
Trace: view
Modified: Thu Nov 26 11:29:20 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
LineSource
  /kat0/fletcher/SATE/2010/pvm3/src/tdpro.c
  Enter tm_mca
1863 tm_mca(tp, mp) 
1864         struct task *tp;
1865         struct pmsg *mp;
1866 {
1867         struct mca *mcap;                       /* mca descriptor */ 
1868         int ndst;                                       /* num of dst tids */ 
1869         int *dsts;                                      /* dst tids */ 
1870         int tid;
1871         int i, j;
1872  
1873         /*
1874         * unpack list of dst tids from message (expect it to be sorted).
1875         * discard tids to nonexistent foreign hosts.
1876         */ 
1877  
1878         mcap = mca_new();
1879         mcap->mc_tid = TIDGID | tp->t_tid;   /* Null Pointer Dereference (ID: 305.28982) */
1880         upkint(mp, &ndst);
1881         dsts = TALLOC(ndst, int, "dsts");   /* Integer Overflow of Allocation Size (ID: 304.28981) */
1882         for ( i=0, j=0 ; i < ndst ; i++ ) {
1883                 upkuint(mp, &tid);
1884                 if ((tid & tidhmask) == myhostpart || tidtohost(hosts, tid))
1885                         dsts[j++] = tid;   /* Null Pointer Dereference (ID: 303.28980) */
1886         }
1887         ndst = j;
1888  
1889         if (ndst < 1)
1890                 goto noguys;
1891  
1892         /*
1893         * send DM_MCA messages containing tids to destination hosts 
1894         * make list of destination hosts for us 
1895         */ 
1896  
1897         mcap->mc_dsts = TALLOC(ndst, int, "mcal");      /* XXX cheat, too much space */   /* Integer Overflow of Allocation Size (ID: 301.28978) */
1898         mcap->mc_ndst = 0;     /* Useless Assignment */
1899  
1900         for (j = 0; j < ndst; ) {
1901                 i = j;
1902                 tid = dsts[i] & tidhmask;   /* Null Pointer Dereference (ID: 300.28977) */
1903                 while (++j < ndst && tid == (dsts[j] & tidhmask)) ;
1904                 mp = mesg_new(0);
1905                 mp->m_dst = (tid |= TIDPVMD);   /* Null Pointer Dereference (ID: 299.28976) */
1906                 mp->m_tag = DM_MCA;
1907                 pkint(mp, mcap->mc_tid);
1908                 pkint(mp, j - i);
1909                 while (i < j)
1910                         pkint(mp, dsts[i++]);   /* Buffer Underrun (ID: 298.28975) */
1911                 sendmessage(mp);
1912                 mcap->mc_dsts[mcap->mc_ndst++] = tid;   /* Null Pointer Dereference (ID: 297.28974) */
1913         }
1914  
1915 noguys: 
1916         PVM_FREE(dsts);   /* Free Null Pointer (ID: 302.28979) */
1917  
1918         /*
1919         * tag task descriptor with mca desc and send mca back to task 
1920         */ 
1921  
1922         tp->t_mca = mcap;
1923  
1924         if (pvmdebmask & PDMMESSAGE) {
1925                 pvmlogprintf("tm_mca() made mca %x for t%x\n",
1926                                 mcap->mc_tid, tp->t_tid);
1927         }
1928         return 0;
1929 } 




Change Warning 296.28973 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: