]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure that argument to 'verify' is a constant expression.
authorPhilipp Stephani <phst@google.com>
Thu, 22 Apr 2021 14:11:10 +0000 (16:11 +0200)
committerPhilipp Stephani <phst@google.com>
Thu, 22 Apr 2021 14:11:10 +0000 (16:11 +0200)
Casting NULL is not a constant expression (Bug#47951).

* lib-src/seccomp-filter.c (main): Turn check for null pointer
representation into a runtime assertion.

lib-src/seccomp-filter.c

index 31d0809f8f079a6ea3d93488486e9d16cf012bb0..dc568e035b59e8424420caecad33ca71c0676c67 100644 (file)
@@ -35,6 +35,7 @@ variants of those files that can be used to sandbox Emacs before
 
 #include "config.h"
 
+#include <assert.h>
 #include <errno.h>
 #include <limits.h>
 #include <stdarg.h>
@@ -169,7 +170,7 @@ main (int argc, char **argv)
   verify (sizeof (long) == 8 && LONG_MIN == INT64_MIN
           && LONG_MAX == INT64_MAX);
   verify (sizeof (void *) == 8);
-  verify ((uintptr_t) NULL == 0);
+  assert ((uintptr_t) NULL == 0);
 
   /* Allow a clean exit.  */
   RULE (SCMP_ACT_ALLOW, SCMP_SYS (exit));