[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>
diff --git a/usr/dash/eval.c b/usr/dash/eval.c
index d675ba7..8dc84ce 100644
--- a/usr/dash/eval.c
+++ b/usr/dash/eval.c
@@ -901,9 +901,9 @@
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 @@
saveparam = shellparam;
savefuncline = funcline;
+ savehandler = handler;
if ((e = setjmp(jmploc.loc))) {
goto funcdone;
}
INTOFF;
- savehandler = handler;
handler = &jmploc;
shellparam.malloc = 0;
func->count++;