diff options
| author | Josh Stone <[email protected]> | 2015-02-11 14:25:37 -0800 |
|---|---|---|
| committer | Josh Stone <[email protected]> | 2015-02-11 15:50:44 -0800 |
| commit | 3d11410c481ead29ac52974d05073057d5ca5264 (patch) | |
| tree | 2195a6e7e8d52aeebfcc508898b33e2e6c2ccfdc | |
| parent | 031db7ce5f149c8469ac33f688a09ffb15c5d85d (diff) | |
tests: ensure backtrace.c exec_dump sets jmp
With CFLAGS='-Og -g', F21 gcc hits -Werror=maybe-uninitialized on jmp in
the call "prepare_thread (pid2, jmp)". It's fine with -O2/-O0.
The only way this could be unset is if the loop before ran to
completion, and there's already an assert against this case.
This patch initializes jmp anyway to convince gcc it's ok.
Signed-off-by: Josh Stone <[email protected]>
| -rw-r--r-- | tests/ChangeLog | 4 | ||||
| -rw-r--r-- | tests/backtrace.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 5091a9b7..9d3290f2 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2015-02-11 Josh Stone <[email protected]> + + * backtrace.c (exec_dump): Initialize jmp. + 2015-02-11 Petr Machata <[email protected]> * run-dwarf-ranges.sh: New test. diff --git a/tests/backtrace.c b/tests/backtrace.c index 331ba0f2..e109654f 100644 --- a/tests/backtrace.c +++ b/tests/backtrace.c @@ -377,7 +377,7 @@ exec_dump (const char *exec) #else /* __x86_64__ */ is_x86_64_native = ehdr->e_ident[EI_CLASS] == ELFCLASS64; #endif /* __x86_64__ */ - void (*jmp) (void); + void (*jmp) (void) = 0; if (is_x86_64_native) { // Find inferior symbol named "jmp". |
