Validate global imports (#8487)
* Add a RuntimeGlobal class to wrap the global's runtime value as well as its definition so we can check its type + mutability for import validation * Global imports are invariant for mutable globals and covariant for immutable globals: <img width="841" height="428" alt="image" src="https://github.com/user-attachments/assets/748cb719-6de9-4dfd-9719-e4051dc31c45" />. Mutability must match as well. * Fix old_import.wast to account for instantiations which should correctly fail. This test is now mostly the same as test/spec/imports.wast, but there are small differences so I plan to keep it until the upstream testsuite imports.wast passes. Example error message: ``` [trap Imported global Mref_ex.g-var-func with type: (mut (ref func)) isn't compatible with import declaration: (import "Mref_ex" "g-var-func" (global $gimport$0 (mut funcref))) ] ``` Part of #8261.
S
Steven Fontanella committed
ddb7026c8432c13755d2b02513c6d2784ad7e3bf
Parent: 3ce53e8
Committed by GitHub <noreply@github.com>
on 3/25/2026, 8:48:48 PM