strange object vs generic objects

Try to fix a fuzzer issue.  I wasn't able to reproduce it so am not
sure whether this actually fixes it.  A mimic seemed to be mimicking
object #1 (generic ILLOBJ_CLASS object which shouldn't occur) rather
than #0 (strange object).  Strange object always has dknown==1 and
generic objects should always have dknown==0 but farlook of mystery
object #1 had its dknown flag set.

An earlier fix to force non-Null oc_name when formatting objects in
order to pacify the static analyzer might have been the reason that
the problem couldn't be reproduced.

This includes a few miscellaneous changes made while unsuccessfully
hunting for the problem.
This commit is contained in:
PatR
2023-01-15 01:45:14 -08:00
parent 6abb12aee0
commit 2e1f52e882
5 changed files with 25 additions and 19 deletions

View File

@@ -1443,7 +1443,7 @@ extern void free_omailcmd(struct obj *);
extern struct obj *mkobj_at(char, coordxy, coordxy, boolean);
extern struct obj *mksobj_at(int, coordxy, coordxy, boolean, boolean);
extern struct obj *mksobj_migr_to_species(int, unsigned, boolean, boolean);
extern struct obj *mkobj(int, boolean);
extern struct obj *mkobj(int, boolean) NONNULL;
extern int rndmonnum_adj(int, int);
extern int rndmonnum(void);
extern boolean bogon_is_pname(char);
@@ -1457,7 +1457,7 @@ extern void bill_dummy_object(struct obj *);
extern void costly_alteration(struct obj *, int);
extern void clear_dknown(struct obj *);
extern void unknow_object(struct obj *);
extern struct obj *mksobj(int, boolean, boolean);
extern struct obj *mksobj(int, boolean, boolean) NONNULL;
extern int bcsign(struct obj *);
extern int weight(struct obj *);
extern struct obj *mkgold(long, coordxy, coordxy);