diff options
author | Anthony Ramine <[email protected]> | 2013-10-14 23:26:56 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2013-12-02 15:20:49 +0100 |
commit | ce785835f3fcbab8b6c07e2415b5f636d181c28d (patch) | |
tree | 8aa3a9cb6fa59455f407f2fc91122a3b105cbc44 /erts/emulator/beam/erl_alloc_util.c | |
parent | 8d48725f062b16d94fc3371d2940d451b94a141d (diff) | |
download | otp-ce785835f3fcbab8b6c07e2415b5f636d181c28d.tar.gz otp-ce785835f3fcbab8b6c07e2415b5f636d181c28d.tar.bz2 otp-ce785835f3fcbab8b6c07e2415b5f636d181c28d.zip |
Remove uninitialized use of new_crr in erl_alloc_util
When the offending code is reached, new_crr is either uninitalized or
have been set to NULL. This patch removes the following warning:
beam/erl_alloc_util.c:3510:6: warning: variable 'new_crr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (!(flags & CFLG_FORCE_MSEG)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
beam/erl_alloc_util.c:3567:23: note: uninitialized use occurs here
DEBUG_SAVE_ALIGNMENT(new_crr);
^~~~~~~
beam/erl_alloc_util.c:674:51: note: expanded from macro 'DEBUG_SAVE_ALIGNMENT'
UWord algnmnt__ = sizeof(Unit_t) - (((UWord) (C)) % sizeof(Unit_t));\
^
beam/erl_alloc_util.c:3510:2: note: remove the 'if' if its condition is always true
if (!(flags & CFLG_FORCE_MSEG)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
beam/erl_alloc_util.c:3438:23: note: initialize the variable 'new_crr' to silence this warning
Carrier_t *new_crr, *old_crr;
^
= NULL
Diffstat (limited to 'erts/emulator/beam/erl_alloc_util.c')
-rw-r--r-- | erts/emulator/beam/erl_alloc_util.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c index 3914537d0d..c6cea0185f 100644 --- a/erts/emulator/beam/erl_alloc_util.c +++ b/erts/emulator/beam/erl_alloc_util.c @@ -3570,7 +3570,6 @@ resize_carrier(Allctr_t *allctr, Block_t *old_blk, Uint umem_sz, UWord flags) /* Old carrier unchanged; restore... */ STAT_SYS_ALLOC_SBC_ALLOC(allctr, old_crr_sz, old_blk_sz); } - DEBUG_SAVE_ALIGNMENT(new_crr); return new_blk; } #endif |