diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-07-03 19:07:59 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-03 19:08:11 -0400 |
commit | 8f8d756c5a29217ff79154caa1696b6e572d186f (patch) | |
tree | 868ee6758b80e7af56907fa6a022eb9420ca811e /rts | |
parent | 5aee331152c251525bc73b792660851dc5dddc29 (diff) | |
download | haskell-8f8d756c5a29217ff79154caa1696b6e572d186f.tar.gz |
rts: Fix uninitialised variable uses
Strangely gcc 5.4 compiling on amd64 (nixos) complained about these.
Both warnings look correct, so I'm not sure why we haven't been seeing
these up until now.
Test Plan: Validate
Reviewers: simonmar, austin, erikd
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3693
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Interpreter.c | 2 | ||||
-rw-r--r-- | rts/sm/MarkWeak.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c index a2f0b5898e..a22e966ff3 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -285,7 +285,7 @@ interpretBCO (Capability* cap) // that these entities are non-aliasable. register StgPtr Sp; // local state -- stack pointer register StgPtr SpLim; // local state -- stack lim pointer - register StgClosure *tagged_obj = 0, *obj; + register StgClosure *tagged_obj = 0, *obj = NULL; uint32_t n, m; LOAD_THREAD_STATE(); diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c index 691e56af5f..9a077b3d14 100644 --- a/rts/sm/MarkWeak.c +++ b/rts/sm/MarkWeak.c @@ -364,7 +364,7 @@ static void tidyThreadList (generation *gen) static void checkWeakPtrSanity(StgWeak *hd, StgWeak *tl) { StgWeak *w, *prev; - for (w = hd; w != NULL; prev = w, w = w->link) { + for (prev = NULL, w = hd; w != NULL; prev = w, w = w->link) { ASSERT(INFO_PTR_TO_STRUCT(UNTAG_CLOSURE((StgClosure*)w)->header.info)->type == WEAK || UNTAG_CLOSURE((StgClosure*)w)->header.info == &stg_DEAD_WEAK_info); checkClosure((StgClosure*)w); |