Skip to content

Commit 4f8f372

Browse files
authored
Merge pull request #1143 from joe-lawrence/create-diff-object-uninit
create-diff-object: cleanup maybe-uninitialized compiler complaints
2 parents 8cc7ebf + 78325e4 commit 4f8f372

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ before_install:
33
- sudo apt-get -qq update
44
- sudo apt-get install -y libelf-dev linux-headers-$(uname -r) shellcheck elfutils
55

6+
jobs:
7+
include:
8+
- name: "Default"
9+
- name: "-O2"
10+
env: CFLAGS="-O2"
11+
- name: "-O3"
12+
env: CFLAGS="-O3"
13+
614
script:
715
- make
816
- make unit

kpatch-build/create-diff-object.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ static bool should_keep_jump_label(struct lookup_table *lookup,
21352135
unsigned int group_size,
21362136
int *jump_labels_found)
21372137
{
2138-
struct rela *code, *key, *rela;
2138+
struct rela *code = NULL, *key = NULL, *rela;
21392139
bool tracepoint = false, dynamic_debug = false;
21402140
struct lookup_result symbol;
21412141
int i = 0;
@@ -2156,7 +2156,7 @@ static bool should_keep_jump_label(struct lookup_table *lookup,
21562156
}
21572157
}
21582158

2159-
if (i != 3)
2159+
if (i != 3 || !key || !code)
21602160
ERROR("BUG: __jump_table has an unexpected format");
21612161

21622162
if (!strncmp(key->sym->name, "__tracepoint_", 13))

0 commit comments

Comments
 (0)