Revert "fix crash on NULL gi.invent"

This reverts commit 378648bd9c.

The problem was triggered by marking the 'objlist' argument in
merge_choice() prototype with __attribute__((nonnull)) when it
shouldn't have been, then a followup which relied on that.  The
'objlist' argument might be Null.  Instead of passing its address to
force it to be non-Null, remove the attribute.
This commit is contained in:
PatR
2024-02-01 14:25:23 -08:00
parent 2a5a7160c9
commit 16f4bdb5a6
6 changed files with 27 additions and 29 deletions
+2 -2
View File
@@ -1699,7 +1699,7 @@ lift_object(
if (obj->otyp == LOADSTONE
|| (obj->otyp == BOULDER && throws_rocks(gy.youmonst.data))) {
if (inv_cnt(FALSE) < invlet_basic || !carrying(obj->otyp)
|| merge_choice(&gi.invent, obj))
|| merge_choice(gi.invent, obj))
return 1; /* lift regardless of current situation */
/* if we reach here, we're out of slots and already have at least
one of these, so treat this one more like a normal item
@@ -1719,7 +1719,7 @@ lift_object(
/* [exception for gold coins will have to change
if silver/copper ones ever get implemented] */
&& inv_cnt(FALSE) >= invlet_basic
&& !merge_choice(&gi.invent, obj)) {
&& !merge_choice(gi.invent, obj)) {
/* if there is some gold here (and we haven't already skipped it),
we aren't limited by the 52 item limit for it, but caller and
"grandcaller" aren't prepared to skip stuff and then pickup