This bug is marked as a duplicate of #504121.
#504121 has been fixed with f980e90c5539626c007de121278e66acdb91d37c, but the test case from comment #1 still fails: failed AVER: (ZEROP (HASH-TABLE-COUNT (CORE-OBJECT-PATCH-TABLE OBJECT))
This is understandable as the test case doesn't have bad local calls, which #504121 is about.
I am therefore removing the duplicate link.

That bug is actually simpler: we tried to dump a reference to a closure for an inlined (i.e. toplevel) function. It looks like a ton of invariants are broken there, but the tiny patch attached seems to DTRT. I'll apply if there aren't objections or questions by tomorrow.