Skip to content

Commit 2c6a538

Browse files
committed
[erts] Silence faulty CodeChecker warnings
1 parent 9d4999d commit 2c6a538

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

erts/emulator/beam/bif.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ BIF_RETTYPE link_1(BIF_ALIST_1)
159159
if (!prt)
160160
goto res_no_proc;
161161

162+
ERTS_UNDEF(ref, THE_NON_VALUE);
163+
162164
lnk = erts_link_internal_tree_lookup_create(&ERTS_P_LINKS(BIF_P),
163165
&created,
164166
ERTS_LNK_TYPE_PORT,
@@ -1100,6 +1102,8 @@ BIF_RETTYPE unlink_1(BIF_ALIST_1)
11001102
ErtsPortOpResult res = ERTS_PORT_OP_DROPPED;
11011103
Port *prt;
11021104

1105+
ERTS_UNDEF(ref, THE_NON_VALUE);
1106+
11031107
/* Send unlink signal */
11041108
prt = erts_port_lookup(BIF_ARG_1, ERTS_PORT_SFLGS_DEAD);
11051109
if (!prt) {

erts/emulator/beam/erl_alloc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,6 +2867,7 @@ erts_allocator_options(void *proc)
28672867
hpp = NULL;
28682868
szp = &sz;
28692869
sz = 0;
2870+
ERTS_UNDEF(hp, NULL);
28702871

28712872
bld_term:
28722873

erts/emulator/beam/erl_bif_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3870,6 +3870,7 @@ fun_info_2(BIF_ALIST_2)
38703870
case am_module:
38713871
/* Unloaded funs must report their module even though we can't find
38723872
* their full MFA. */
3873+
ASSERT(fe != NULL || mfa != NULL);
38733874
val = (mfa != NULL) ? mfa->module : fe->module;
38743875
hp = HAlloc(p, 3);
38753876
break;

erts/emulator/beam/erl_db_hash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@ int db_erase_hash(DbTable *tbl, Eterm key, Eterm *ret)
15851585
bp = &b->next;
15861586
b = b->next;
15871587
}
1588+
ERTS_UNDEF(nitems, -1);
15881589
if (nitems_diff) {
15891590
ADD_NITEMS(tb, lck_ctr, hval, nitems_diff);
15901591
nitems = NITEMS_ESTIMATE(tb, lck_ctr, hval);
@@ -1650,6 +1651,7 @@ static int db_erase_object_hash(DbTable *tbl, Eterm object, Eterm *ret)
16501651
bp = &b->next;
16511652
b = b->next;
16521653
}
1654+
ERTS_UNDEF(nitems, -1);
16531655
if (nitems_diff) {
16541656
ADD_NITEMS(tb, lck_ctr, hval, nitems_diff);
16551657
nitems = NITEMS_ESTIMATE(tb, lck_ctr, hval);
@@ -2915,6 +2917,7 @@ static int db_take_hash(Process *p, DbTable *tbl, Eterm key, Eterm *ret)
29152917
break;
29162918
}
29172919
}
2920+
ERTS_UNDEF(nitems, -1);
29182921
if (nitems_diff) {
29192922
ADD_NITEMS(tb, lck_ctr, hval, nitems_diff);
29202923
nitems = NITEMS_ESTIMATE(tb, lck_ctr, hval);

erts/emulator/beam/erl_proc_sig_queue.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4184,6 +4184,7 @@ handle_exit_signal(Process *c_p, ErtsSigRecvTracing *tracing,
41844184
Eterm reason;
41854185
Eterm from;
41864186

4187+
ERTS_UNDEF(reason, THE_NON_VALUE);
41874188
ASSERT(ERTS_PROC_SIG_TYPE(tag) == ERTS_SIG_Q_TYPE_GEN_EXIT);
41884189

41894190
xsigd = get_exit_signal_data(sig);
@@ -4670,6 +4671,8 @@ handle_persistent_mon_msg(Process *c_p, Uint16 type,
46704671
ErtsMessage *first = NULL, *prev, *last;
46714672
Uint hsz = size_object(msg);
46724673
Uint i;
4674+
ERTS_UNDEF(last,NULL);
4675+
ERTS_UNDEF(prev,NULL);
46734676

46744677
for (i = 0; i < n; i++) {
46754678
Eterm *hp;

erts/emulator/beam/erl_process.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10674,6 +10674,7 @@ execute_sys_tasks(Process *c_p, erts_aint32_t *statep, int in_reds)
1067410674
if (c_p->flags & F_DISABLE_GC) {
1067510675
save_gc_task(c_p, st, st_prio);
1067610676
st = NULL;
10677+
ERTS_UNDEF(st_res, am_undefined);
1067710678
reds--;
1067810679
}
1067910680
else {
@@ -10687,6 +10688,7 @@ execute_sys_tasks(Process *c_p, erts_aint32_t *statep, int in_reds)
1068710688
if (c_p->flags & (F_DIRTY_MAJOR_GC|F_DIRTY_MINOR_GC)) {
1068810689
save_dirty_task(c_p, st);
1068910690
st = NULL;
10691+
ERTS_UNDEF(st_res, am_undefined);
1069010692
break;
1069110693
}
1069210694
if (type == ERTS_PSTT_GC_MAJOR)
@@ -10729,6 +10731,7 @@ execute_sys_tasks(Process *c_p, erts_aint32_t *statep, int in_reds)
1072910731
* but instead unconditionally schedule this as dirty
1073010732
* work...
1073110733
*/
10734+
ERTS_UNDEF(st_res, am_undefined);
1073210735
if (c_p->flags & F_DISABLE_GC) {
1073310736
/* We might need to GC, but GC was disabled */
1073410737
save_gc_task(c_p, st, st_prio);
@@ -12945,8 +12948,10 @@ erts_send_local_spawn_reply(Process *parent, ErtsProcLocks parent_locks,
1294512948

1294612949
type = child ? am_ok : am_error;
1294712950

12948-
if (have_seqtrace(token) && child)
12951+
if (have_seqtrace(token) && child) {
1294912952
token_sz = size_object(token);
12953+
ERTS_UNDEF(token_copy, NIL);
12954+
}
1295012955
else {
1295112956
token_copy = token = NIL;
1295212957
token_sz = 0;

0 commit comments

Comments
 (0)