Skip to content

v0.8.1 — cement null-global skip with empirical crash finding

Choose a tag to compare

@KenM76 KenM76 released this 11 Jun 15:44
· 5 commits to main since this release

Empirically verified that v0.8.0's conservative skip of null reference-type globals was the right call. A downstream session asked whether the workaround (use `If Not IsObject(swDrawing)` instead of the idiomatic `If swDrawing Is Nothing`, and give up `Option Explicit`) was a real constraint. Testing the alternative — register null globals and return `S_OK` + `ppiunkItem=null` from `GetItemInfo` — produced a hard access violation 0xC0000005 inside `vbscript.dll` during `SetScriptState(SCRIPTSTATE_CONNECTED)`. The engine simply dereferences the null dispatch pointer without defending against it.

The docs' "If the item cannot be located, this parameter is set to NULL" wording reads like null might mean Nothing. It does not.

Changes

  • Reverted the experimental "register null globals" path back to skip
  • Inline code comment updated with the empirical crash finding so the next implementer doesn't re-run the same test
  • Skip-list warning now includes the exact workaround pattern: `guard with If Not IsObject(<name>), not If <name> Is Nothing`
  • personal_rag lesson updated with the crash result (previously speculative)

The host's three contracts (now empirically locked)

  1. Value-type globals skipped — boxed primitives have no COM identity
  2. Null reference-type globals skipped — engine crashes on null IUnknown
  3. `WScript.Arguments` deferred — use `ScriptArgs` channel (this one is ergonomic, not a hard constraint)

Downstream scripts must work around all three. The first two are dictated by the IActiveScript/COM contract; only the third is a deliberate combridge scope reduction.