Merge pull request #1143 from joe-lawrence/create-diff-object-uninit

create-diff-object: cleanup maybe-uninitialized compiler complaints
This commit is contained in:
Joe Lawrence 2020-09-10 11:16:03 -04:00 committed by GitHub
commit 4f8f37268d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -3,6 +3,14 @@ before_install:
- sudo apt-get -qq update - sudo apt-get -qq update
- sudo apt-get install -y libelf-dev linux-headers-$(uname -r) shellcheck elfutils - sudo apt-get install -y libelf-dev linux-headers-$(uname -r) shellcheck elfutils
jobs:
include:
- name: "Default"
- name: "-O2"
env: CFLAGS="-O2"
- name: "-O3"
env: CFLAGS="-O3"
script: script:
- make - make
- make unit - make unit

View File

@ -2135,7 +2135,7 @@ static bool should_keep_jump_label(struct lookup_table *lookup,
unsigned int group_size, unsigned int group_size,
int *jump_labels_found) int *jump_labels_found)
{ {
struct rela *code, *key, *rela; struct rela *code = NULL, *key = NULL, *rela;
bool tracepoint = false, dynamic_debug = false; bool tracepoint = false, dynamic_debug = false;
struct lookup_result symbol; struct lookup_result symbol;
int i = 0; int i = 0;
@ -2156,7 +2156,7 @@ static bool should_keep_jump_label(struct lookup_table *lookup,
} }
} }
if (i != 3) if (i != 3 || !key || !code)
ERROR("BUG: __jump_table has an unexpected format"); ERROR("BUG: __jump_table has an unexpected format");
if (!strncmp(key->sym->name, "__tracepoint_", 13)) if (!strncmp(key->sym->name, "__tracepoint_", 13))