mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-28 07:59:50 +02:00
commit bash-20170505 snapshot
This commit is contained in:
@@ -283,8 +283,13 @@ popexp ()
|
||||
{
|
||||
EXPR_CONTEXT *context;
|
||||
|
||||
if (expr_depth == 0)
|
||||
evalerror (_("recursion stack underflow"));
|
||||
if (expr_depth <= 0)
|
||||
{
|
||||
/* See the comment at the top of evalexp() for an explanation of why
|
||||
this is done. */
|
||||
expression = lasttp = 0;
|
||||
evalerror (_("recursion stack underflow"));
|
||||
}
|
||||
|
||||
context = expr_stack[--expr_depth];
|
||||
|
||||
@@ -307,7 +312,8 @@ expr_unwind ()
|
||||
|
||||
free (expr_stack[expr_depth]);
|
||||
}
|
||||
free (expr_stack[expr_depth]); /* free the allocated EXPR_CONTEXT */
|
||||
if (expr_depth == 0)
|
||||
free (expr_stack[expr_depth]); /* free the allocated EXPR_CONTEXT */
|
||||
|
||||
noeval = 0; /* XXX */
|
||||
}
|
||||
@@ -397,6 +403,9 @@ evalexp (expr, flags, validp)
|
||||
|
||||
expr_unwind ();
|
||||
|
||||
/* We copy in case we've called evalexp recursively */
|
||||
FASTCOPY (oevalbuf, evalbuf, sizeof (evalbuf));
|
||||
|
||||
if (validp)
|
||||
*validp = 0;
|
||||
return (0);
|
||||
@@ -1456,11 +1465,11 @@ evalerror (msg)
|
||||
char *name, *t;
|
||||
|
||||
name = this_command_name;
|
||||
for (t = expression; whitespace (*t); t++)
|
||||
for (t = expression; t && whitespace (*t); t++)
|
||||
;
|
||||
internal_error (_("%s%s%s: %s (error token is \"%s\")"),
|
||||
name ? name : "", name ? ": " : "", t,
|
||||
msg, (lasttp && *lasttp) ? lasttp : "");
|
||||
name ? name : "", name ? ": " : "",
|
||||
t ? t : "", msg, (lasttp && *lasttp) ? lasttp : "");
|
||||
sh_longjmp (evalbuf, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user