Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: compiler crash when compiling for iOS
Summary ======= Fix a compiler crash when compiling any program for iOS with threading enabled. Only the iOS target was affected. Details ======= Due to `StrTab` ordering, within the `system` module, all calls to `sizeof` outside of generic routines resolve to the `sizeof(x: T)` symbol, foregoing overload resolution since `sizeof` is an "eager" magic. If called with the symbol of a type that has an unknown size (which happens in a `when defined(ios)` guarded part of `syslocks`), the first parameter's type of the callee reaching `mirgen` is a `tyGenericParam`, and thus `mirgen.genArgs` attempts to translate the `skType` symbol like a normal expression, triggering an assertion. Always using overload resolution for `sizeof` would result in unnecessary generic instantiations, so `mirgen` now uses dedicated handling for the `mSizeOf` magic, always translating argument as a type, thus fixing the crash.
- Loading branch information