aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-07-08 16:41:24 +0800
committermaximilian attems <max@stro.at>2012-07-02 10:44:58 +0200
commit973826c37ec8492514a8dae5b507d0873ee5afb2 (patch)
tree11c00eefd8ddda5a9750d1e730ef9a8b5ed01f3f
parentd182c7440dd5cd9290f2fb8dd7bc0f9dc2c4cb83 (diff)
downloadklibc-973826c37ec8492514a8dae5b507d0873ee5afb2.tar.gz
[klibc] [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: maximilian attems <max@stro.at>
-rw-r--r--usr/dash/eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index d675ba764397b..8dc84ce95fd5a 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -901,9 +901,9 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags)
int i;
savecmdname = commandname;
+ savehandler = handler;
if ((i = setjmp(jmploc.loc)))
goto cmddone;
- savehandler = handler;
handler = &jmploc;
commandname = argv[0];
argptr = argv + 1;
@@ -934,11 +934,11 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
saveparam = shellparam;
savefuncline = funcline;
+ savehandler = handler;
if ((e = setjmp(jmploc.loc))) {
goto funcdone;
}
INTOFF;
- savehandler = handler;
handler = &jmploc;
shellparam.malloc = 0;
func->count++;