Skip to content

v0.8.1

Choose a tag to compare

@github-actions github-actions released this 07 Nov 13:18
· 14 commits to main since this release
v0.8.1
f6a3fc2

Fixes a Crash Resolving Methods on Nested Stdlib Types

ziglint 0.8.0 could segfault, or report the wrong thing, on a call to a method
of a stdlib type that is declared inside a module std.zig imports, such as
std.zig.Color.settingFromEnvironment(...) or
std.zig.EnvVar.ZIG_LOCAL_CACHE_DIR.get(...). Whether it crashed depended on
memory layout, so the same tree could pass on one run and crash on the next,
and passing --zig-lib-path only moved the crash around.

Fixes

  • Resolver (use-after-free): the stdlib lookup follows imports through
    paths it owns and frees them when it returns. For a type declared inside an
    imported module, the method's definition kept pointing at that freed path.
    The arena reuses those bytes at once, so Z011, Z029, and the other checks
    that resolve a called function could look the definition up in a different
    module (on Zig 0.17, std.zig instead of zig.zig) and read past that
    module's node array. The definition now names its module through the module
    graph's own copy of the path.

Installation

mise use github:rockorager/ziglint@v0.8.1