Procházet zdrojové kódy

dpkg: Switch an assert() on a volatile variable to an internerr()

The assert() has a side-effect as the variable is volatile, switch it
to an internerr() so that we always get the same result regardless of
the build settings, NDEBUG in this case.

Warned-by: coverity
Guillem Jover před 12 roky
rodič
revize
cdff05813b
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      src/packages.c

+ 2 - 1
src/packages.c

@@ -221,7 +221,8 @@ void process_queue(void) {
       }
     }
 
-    assert(pkg->status <= stat_installed);
+    if (pkg->status > stat_installed)
+      internerr("package status (%d) > stat_installed", pkg->status);
 
     if (setjmp(ejbuf)) {
       /* Give up on it from the point of view of other packages, i.e. reset