blob: e2966cbea4d6d0a9d42dff29344ecbe6f75e1654 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 4d7ea681932556ad881f6841de90d0bfff56f8d7 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:25:16 +0800
4Subject: [PATCH 5/7] fix a stack-usage warning
5
6Upstream-Status: Pending
7
8not use a variable to as a array size, otherwise the warning to error
9that
10stack usage might be unbounded [-Werror=stack-usage=] will happen
11
12Signed-off-by: Roy Li <rongqing.li@windriver.com>
13
14Rebase to 0.170
15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
16---
17 backends/ppc_initreg.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021index 3e4432f..59c2d97 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022--- a/backends/ppc_initreg.c
23+++ b/backends/ppc_initreg.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024@@ -94,7 +94,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025 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--
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800342.7.4
Brad Bishopd7bf8c12018-02-25 22:55:05 -050035