From bc7d7b8843c84103e22e8080d069dfa6a52fb463 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 20 Jun 2020 09:13:51 -0700 Subject: structs: bugfix: wrong warning about no such static slot * struct.c (static_slot_types): If a symbol is attached to an empty type list in the static slot hash, then try triggering auto-load on it. This function's result is relied on by the struct macros for generating warnings; if we don't probe the autload, we get spurious warnings about symbols not being the name of any static slot. (static_slot_type_reg): Copy and paste bug: store the type into the correct, static slot type hash instead of the instance slot type hash. --- struct.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/struct.c b/struct.c index ccdb939f..95b72b9f 100644 --- a/struct.c +++ b/struct.c @@ -1889,7 +1889,10 @@ val slot_types(val slot) val static_slot_types(val slot) { - return gethash(static_slot_type_hash, slot); + uses_or2; + return or2(gethash(static_slot_type_hash, slot), + if2(lisplib_try_load(slot), + gethash(static_slot_type_hash, slot))); } val slot_type_reg(val slot, val strct) @@ -1909,7 +1912,7 @@ val static_slot_type_reg(val slot, val strct) val typelist = gethash(static_slot_type_hash, slot); if (!memq(strct, typelist)) { - sethash(slot_type_hash, slot, cons(strct, typelist)); + sethash(static_slot_type_hash, slot, cons(strct, typelist)); uw_purge_deferred_warning(cons(slot_s, slot)); } -- cgit v1.2.3