Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From dd6dbf6af396519380f48c0ef1ce6cf4dd77f6d7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Tue, 15 Aug 2017 17:25:16 +0800 |
| 4 | Subject: [PATCH 5/7] fix a stack-usage warning |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | not use a variable to as a array size, otherwise the warning to error |
| 9 | that |
| 10 | stack usage might be unbounded [-Werror=stack-usage=] will happen |
| 11 | |
| 12 | Signed-off-by: Roy Li <rongqing.li@windriver.com> |
| 13 | |
| 14 | Rebase to 0.170 |
| 15 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 16 | --- |
| 17 | backends/ppc_initreg.c | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 | |
| 20 | diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c |
| 21 | index 69d623b..de41dec 100644 |
| 22 | --- a/backends/ppc_initreg.c |
| 23 | +++ b/backends/ppc_initreg.c |
| 24 | @@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), |
| 25 | return false; |
| 26 | } |
| 27 | const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr); |
| 28 | - Dwarf_Word dwarf_regs[gprs]; |
| 29 | + Dwarf_Word dwarf_regs[sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr)]; |
| 30 | for (unsigned gpr = 0; gpr < gprs; gpr++) |
| 31 | dwarf_regs[gpr] = user_regs.r.gpr[gpr]; |
| 32 | if (! setfunc (0, gprs, dwarf_regs, arg)) |
| 33 | -- |
| 34 | 1.8.3.1 |
| 35 | |