summaryrefslogtreecommitdiffstats
path: root/struct.c
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
commitbc7d7b8843c84103e22e8080d069dfa6a52fb463 (patch)
treec1f414dd5e480f239bca4b2d5beeb974bdaea967 /struct.c
parentf61bf72e61f012e173acc15dfda71a3e5371bde1 (diff)
downloadtxr-bc7d7b8843c84103e22e8080d069dfa6a52fb463.tar.gz
txr-bc7d7b8843c84103e22e8080d069dfa6a52fb463.tar.bz2
txr-bc7d7b8843c84103e22e8080d069dfa6a52fb463.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.
Diffstat (limited to 'struct.c')
-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));
}