diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-30 11:30:11 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-30 11:30:11 +0200 |
commit | a2d121cc1bb8ef391f9171bb3799e1572904d74c (patch) | |
tree | a73704fff2dfa0eb7b70a2697164a42c32bcb08f /shell/ash.c | |
parent | 53d6e03a0acb31cdb5c6e5679cf8a9ddd8c09ba5 (diff) | |
download | busybox-w32-a2d121cc1bb8ef391f9171bb3799e1572904d74c.tar.gz busybox-w32-a2d121cc1bb8ef391f9171bb3799e1572904d74c.tar.bz2 busybox-w32-a2d121cc1bb8ef391f9171bb3799e1572904d74c.zip |
ash: [EVAL] Avoid using undefined handler
Upstream commit:
Date: Fri, 8 Jul 2011 16:41:24 +0800
[EVAL] Avoid using undefined handler
* src/eval.c (evalbltin, evalfun): Set savehandler before calling
setjmp with the possible "goto *done", where savehandler is used.
Otherwise, clang warns that "Assigned value is garbage or undefined"
at the point where "savehandler" is used on the RHS.
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index 3fe4714c2..db943f6c7 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -8944,12 +8944,12 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) | |||
8944 | 8944 | ||
8945 | saveparam = shellparam; | 8945 | saveparam = shellparam; |
8946 | savelocalvars = localvars; | 8946 | savelocalvars = localvars; |
8947 | savehandler = exception_handler; | ||
8947 | e = setjmp(jmploc.loc); | 8948 | e = setjmp(jmploc.loc); |
8948 | if (e) { | 8949 | if (e) { |
8949 | goto funcdone; | 8950 | goto funcdone; |
8950 | } | 8951 | } |
8951 | INT_OFF; | 8952 | INT_OFF; |
8952 | savehandler = exception_handler; | ||
8953 | exception_handler = &jmploc; | 8953 | exception_handler = &jmploc; |
8954 | localvars = NULL; | 8954 | localvars = NULL; |
8955 | shellparam.malloced = 0; | 8955 | shellparam.malloced = 0; |
@@ -9595,10 +9595,10 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv) | |||
9595 | int i; | 9595 | int i; |
9596 | 9596 | ||
9597 | savecmdname = commandname; | 9597 | savecmdname = commandname; |
9598 | savehandler = exception_handler; | ||
9598 | i = setjmp(jmploc.loc); | 9599 | i = setjmp(jmploc.loc); |
9599 | if (i) | 9600 | if (i) |
9600 | goto cmddone; | 9601 | goto cmddone; |
9601 | savehandler = exception_handler; | ||
9602 | exception_handler = &jmploc; | 9602 | exception_handler = &jmploc; |
9603 | commandname = argv[0]; | 9603 | commandname = argv[0]; |
9604 | argptr = argv + 1; | 9604 | argptr = argv + 1; |