Text  |   XML   |   Visible Warnings:

irssi-0.8.14 : irssi-0.8.14 analysis 2 : Unreachable Computation  at signals.c:249

Categories: LANG.STRUCT.UC CWE:561
Warning ID: 4751.28226
Procedure: signal_emit_real
Trace: view
Modified: Thu Nov 26 11:08:10 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/irssi-0.8.14/src/core/signals.c
  Enter signal_emit_real
208 static int signal_emit_real(Signal *rec, int params, va_list va,
209                             SignalHook *first_hook) 
210 {
211         const void *arglist[SIGNAL_MAX_ARGUMENTS];
212         Signal *prev_emitted_signal;
213         SignalHook *hook, *prev_emitted_hook;
214         int i, stopped, stop_emit_count, continue_emit_count;
215  
216         for (i = 0; i < SIGNAL_MAX_ARGUMENTS; i++)
217                 arglist[i] = i >= params ? NULL : va_arg(va, const void *);
218  
219         /* signal_stop_by_name("signal"); signal_emit("signal", ...);
220            fails if we compare rec->stop_emit against 0. */ 
221         stop_emit_count = rec->stop_emit;
222         continue_emit_count = rec->continue_emit;
223  
224         signal_ref(rec);
225  
226         stopped = FALSE;
227         rec->emitting++;
228  
229         prev_emitted_signal = current_emitted_signal;
230         prev_emitted_hook = current_emitted_hook;
231         current_emitted_signal = rec;
232  
233         for (hook = first_hook; hook != NULL; hook = hook->next) {
234                 if (hook->func == NULL)
235                         continue; /* removed */ 
236  
237                 current_emitted_hook = hook;
238 #if SIGNAL_MAX_ARGUMENTS != 6 
239 #  error SIGNAL_MAX_ARGUMENTS changed - update code 
240 #endif 
241                 signal_user_data = hook->user_data;
242                 hook->func(arglist[0], arglist[1], arglist[2], arglist[3],
243                            arglist[4], arglist[5]);
244  
245                 if (rec->continue_emit != continue_emit_count)
246                         rec->continue_emit--;
247  
248                 if (rec->stop_emit != stop_emit_count) {
249                         stopped = TRUE;     /* Unreachable Computation */
250                         rec->stop_emit--;
251                         break;
252                 }
253         }
254  
255         current_emitted_signal = prev_emitted_signal;
256         current_emitted_hook = prev_emitted_hook;
257  
258         rec->emitting--;
259         signal_user_data = NULL;
260  
261         if (!rec->emitting) {
262                 g_assert(rec->stop_emit == 0);
263                 g_assert(rec->continue_emit == 0);
264  
265                 if (rec->remove_count > 0)
266                         signal_hooks_clean(rec);
267         }
268  
269         signal_unref(rec);
270         return stopped;
271 } 




Change Warning 4751.28226 : Unreachable Computation

Priority:
State:
Finding:
Owner:
Note: