Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes a SIGFPE crash on x86_64 when evaluating `INT_MIN / -1` or `INT_MIN % -1` for signed integer types. On x86_64, the `idiv` instruction traps when the quotient overflows the destination register. For signed integers, `INT_MIN / -1` produces a result that overflows (e.g., `-2147483648 / -1 = 2147483648` which doesn't fit in Int32). ARM64's `sdiv` instruction wraps instead of trapping. The fix: - For Int8/Int16/Int32: widen to the next larger type before dividing/modding, then truncate back - For Int64: explicitly check for the overflow case and return the wrapped result Fixes #11612 🤖 Prepared with Claude Code |
||
|---|---|---|
| .claude | ||
| .github | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| lean.code-workspace | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.