Commit 685828f7 by Kaveh R. Ghazi Committed by Kaveh Ghazi

builtins.c (expand_builtin_stpcpy): Copy `arglist' before modifying it.

	* builtins.c (expand_builtin_stpcpy): Copy `arglist' before
	modifying it.

From-SVN: r66409
parent 43e9b64b
2003-05-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (expand_builtin_stpcpy): Copy `arglist' before
modifying it.
2003-05-03 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
......
......@@ -2491,13 +2491,15 @@ expand_builtin_stpcpy (arglist, target, mode)
return 0;
else
{
tree newarglist;
tree len = c_strlen (TREE_VALUE (TREE_CHAIN (arglist)));
if (len == 0)
return 0;
len = fold (size_binop (PLUS_EXPR, len, ssize_int (1)));
chainon (arglist, build_tree_list (NULL_TREE, len));
return expand_builtin_memcpy (arglist, target, mode, /*endp=*/2);
newarglist = copy_list (arglist);
chainon (newarglist, build_tree_list (NULL_TREE, len));
return expand_builtin_memcpy (newarglist, target, mode, /*endp=*/2);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment