summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-20 09:13:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-20 09:13:51 -0700
commitbfc65dc8a7b1174fd04a29de32a907d7d248fb5c (patch)
treec1f414dd5e480f239bca4b2d5beeb974bdaea967
parent0e5fcc6f3a054579f85c9b86e3ee81979ba8387e (diff)
downloadtxr-bfc65dc8a7b1174fd04a29de32a907d7d248fb5c.tar.gz
txr-bfc65dc8a7b1174fd04a29de32a907d7d248fb5c.tar.bz2
txr-bfc65dc8a7b1174fd04a29de32a907d7d248fb5c.zip
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.
-rw-r--r--struct.c7
1 files 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));
}