Skip to content

Commit

Permalink
FIX: silent dereferencing NULL pointer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jan 14, 2023
1 parent 287398b commit 5eb72ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/b-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ extern const REBYTE Str_Banner[];
val = Append_Frame(Lib_Context, word, 0);
// Find the related function:
func = Find_Word_Value(Lib_Context, VAL_WORD_SYM(word+1));
if (!func) Crash(9912);
if (!func) { Crash(9912); return; }
*val = *func;
VAL_SET(val, REB_OP);
VAL_SET_EXT(val, VAL_TYPE(func));
Expand Down
4 changes: 3 additions & 1 deletion src/core/f-stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,10 @@
val = aval;
else if (bval && VAL_TYPE(bval) == VAL_TYPE(lval) && VAL_SERIES(bval) == VAL_SERIES(lval))
val = bval;
else
else {
Trap1(RE_INVALID_PART, lval);
return 0; // silent compiler's warning
}

len = (REBINT)VAL_INDEX(lval) - (REBINT)VAL_INDEX(val);
}
Expand Down

0 comments on commit 5eb72ed

Please sign in to comment.