Skip to content

Commit 2211d8a

Browse files
committed
[erts] Silence faulty CodeChecker warnings
1 parent 9d4999d commit 2211d8a

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

erts/emulator/beam/bif.c

+4
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

+1
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

+1
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

+3
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

+3
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

+4-1
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 {
@@ -12945,8 +12946,10 @@ erts_send_local_spawn_reply(Process *parent, ErtsProcLocks parent_locks,
1294512946

1294612947
type = child ? am_ok : am_error;
1294712948

12948-
if (have_seqtrace(token) && child)
12949+
if (have_seqtrace(token) && child) {
1294912950
token_sz = size_object(token);
12951+
ERTS_UNDEF(token_copy, NIL);
12952+
}
1295012953
else {
1295112954
token_copy = token = NIL;
1295212955
token_sz = 0;

0 commit comments

Comments
 (0)