diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-11-03 12:25:10 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-11-03 12:25:10 -0400 |
commit | 82f6d876660ba1132d75ccfef5c4301d123ea505 (patch) | |
tree | 7cda1a32bbb0b75d19ee061d135b10fba3c17656 | |
parent | bump to sandbox-3.2 (diff) | |
download | sandbox-82f6d876660ba1132d75ccfef5c4301d123ea505.tar.gz sandbox-82f6d876660ba1132d75ccfef5c4301d123ea505.tar.bz2 sandbox-82f6d876660ba1132d75ccfef5c4301d123ea505.zip |
libsandbox: tweak label/decl code for some compiler settings
Looks like gcc is inconsistent in when it chokes on this code:
> a label can only be part of a statement and a declaration is not a statement
Hoist the decl up to the top of scope to avoid the issue.
Bug: https://bugs.gentoo.org/821433
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/trace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libsandbox/trace.c b/libsandbox/trace.c index f3390d9..d2899b7 100644 --- a/libsandbox/trace.c +++ b/libsandbox/trace.c @@ -704,6 +704,8 @@ static char *flatten_args(char *const argv[]) bool trace_possible(const char *filename, char *const argv[], const void *data) { + char *args; + /* If YAMA ptrace_scope is very high, then we can't trace at all. #771360 */ int yama = trace_yama_level(); if (yama >= 2) { @@ -721,7 +723,7 @@ bool trace_possible(const char *filename, char *const argv[], const void *data) } fail: - char *args = flatten_args(argv); + args = flatten_args(argv); sb_eqawarn("Unable to trace static ELF: %s: %s\n", filename, args); free(args); return false; |