Table elements reference other table elements. Bad things happen when
references dangle. ef_verify() already checks whether the referenced
table elements exist. This commit makes it check whether the elements
are "in use". This catches stuff like living planes on dead carriers.
val, ef_nameof(tabno), ef_nelem(tabno));
return -1;
}
+ /* laziness: assumes TABNO is EFF_MEM */
+ if (val >= 0 && !empobj_in_use(tabno, ef_ptr(tabno, val))) {
+ verify_fail(type, row, ca, idx,
+ "value %ld refers to missing element of table %s",
+ val, ef_nameof(tabno));
+ return -1;
+ }
}
return 0;
}