remove obj guard from stone_missile(obj) macro
Checking the callers:
toss_up() would have segfaulted prior to use of stone_missile() if obj were NULL.
thitu() now has a guard prior to use of stone_missile()
ohitmon() would have crashed from earlier dereference otmp->dknown if it were NULL,
otmp arg is declared nonnull
thitm() now has a guard prior to use of stone_missile().
hmon_hitmon_do_hit() null obj takes a different code path than the code path
using stone_missile(); comment asserting that added
This commit is contained in:
@@ -17,8 +17,7 @@
|
||||
static struct artifact *get_artifact(struct obj *) NONNULL; /* never returns null */
|
||||
|
||||
/* #define get_artifact(o) \
|
||||
(((o) && ((o)->artifact > 0 && (o)->artifact < AFTER_LAST_ARTIFACT)) \
|
||||
? &artilist[(int) (o)->oartifact] \
|
||||
(((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] \
|
||||
: &artilist[ART_NONARTIFACT]) */
|
||||
|
||||
static boolean bane_applies(const struct artifact *, struct monst *) NONNULLARG12;
|
||||
@@ -2546,8 +2545,7 @@ is_art(struct obj *obj, int art)
|
||||
}
|
||||
|
||||
/* #define get_artifact(o) \
|
||||
(((o) && ((o)->artifact > 0 && (o)->artifact < AFTER_LAST_ARTIFACT)) \
|
||||
? &artilist[(int) (o)->oartifact] \
|
||||
(((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] \
|
||||
: &artilist[ART_NONARTIFACT]) */
|
||||
|
||||
static struct artifact *
|
||||
|
||||
Reference in New Issue
Block a user