The Solidity development team has officially announced the release of Solidity v0.8.37, a maintenance and feature-focused update that addresses multiple critical and lower-severity bugs across the compiler’s compilation pipelines. Alongside these important patches, the new version introduces significant enhancements to the experimental SSA CFG code generator, incorporates support for the upcoming Amsterdam EVM upgrade, and deprecates several legacy features and older EVM target versions.
Primarily positioned as a bugfix release, Solidity v0.8.37 tackles three notable security-related bugs ranging from low to medium severity, alongside two non-security miscompilation issues. The core team has expressed gratitude to the independent security researchers who identified and reported these vulnerabilities through the Ethereum Foundation’s bug bounty program, highlighting the ongoing collaborative effort to secure the Ethereum smart contract ecosystem.
Important Bugfixes
The latest release delivers vital patches for three distinct issues affecting memory operations, IR-based stack management, and error handling constructs.
Memory Byte Array Element Delete Clears 32 Bytes
A critical bug affecting memory byte array management has been resolved in the evmasm pipeline. Previously, when the delete keyword was applied to an individual element of a bytes array stored in memory, the compiler incorrectly generated code that wrote 32 zero bytes starting at that element, rather than clearing a single byte. Consequently, this action overwrote up to 31 subsequent bytes. Depending on the array layout, these affected bytes could belong to later elements within the same array or, if the deleted element was positioned near the end of the data structure, to adjacent memory allocations.
This behavior also extended to string values that had been explicitly converted into bytes. Developers relying on the IR pipeline remained unaffected, and standard index assignments such as b[i] = 0 correctly cleared only a single byte on both pipelines. However, all compiler versions up to and including v0.8.36 were vulnerable when using the default evmasm pipeline. This issue was responsibly disclosed by community researcher shaheenfazim via the Ethereum Foundation bug bounty program.
Spill Slot Collision Across Mutual Recursion
The second major security fix addresses an unsound memory allocation behavior within the IR pipeline’s stack-to-memory mover. To overcome the Ethereum Virtual Machine’s strict stack depth limitations, the compiler periodically relocates local variables to designated memory offsets known as spill slots.
Under specific call graph configurations involving mutual recursion, the compiler failed to reserve a sufficient number of these slots. As a result, variables belonging to two different functions could be inadvertently assigned the exact same spill slot even though both functions’ variables remained live simultaneously. This caused one variable to silently overwrite the other during execution.
This bug bears similarities to an earlier issue addressed in version v0.8.36, which patched unsound spills in mutually recursive functions. Versions 0.7.2 through 0.8.36 are impacted when compiled using the --via-ir flag. The vulnerability was discovered and reported by Ng Sze Hon (gzeoneth) through the Ethereum Foundation bug bounty program.
Misordered Named Parameters in Require with Custom Errors
The third important bugfix corrects an ABI encoding anomaly within the IR pipeline. When developers constructed custom errors using named arguments inside a require statement—such as require(condition, MyError(b: 2, a: 1))—the compiler placed the arguments onto the stack in the order they appeared at the call site rather than following the parameter declaration order defined in the error signature.
During ABI encoding, these misordered values were matched against incorrect parameter types, causing them to be misinterpreted entirely. Although the encoder generated a structurally valid payload conforming to the expected error signature, the payload failed to reflect the actual values instantiated by the developer. Direct revert statements using named parameters, such as revert MyError(...), and other language constructs remained unaffected. Because this issue exclusively impacts the revert data of transactions that are already failing and reverting, it poses no risk to contract state integrity. Carl from Cantina Security reported this bug through the Ethereum Foundation bug bounty program.
Other Miscompilations
In addition to the primary bugfixes, Solidity v0.8.37 resolves two minor miscompilation issues that do not directly involve security vulnerabilities.
The first issue affects uninitialized internal function pointers located within packed storage slots using the evmasm pipeline. When reading an uninitialized internal function pointer from a packed slot where a subsequently stored variable held a non-zero value, the compiler returned an incorrect value. This could lead to a situation where an equality comparison between an uninitialized pointer and a default-initialized local function pointer evaluated incorrectly to false, despite neither pointer ever receiving an explicit assignment. The core team notes that relying on internal function pointer equality is inherently fragile because their underlying values depend on specific bytecode layouts and lack stability across contract upgrades. The compiler already emits warnings for such comparisons and intends to prohibit them entirely in future breaking releases.
The second miscompilation concerns constants evaluated within both checked and unchecked contexts in the IR pipeline. Previously, the code required to compute a constant’s value was generated only once per contract, utilizing either checked or unchecked arithmetic depending entirely on which use site the compiler encountered first. All subsequent use sites reused this initial code block. Consequently, if a constant’s initializer overflowed its data type, reading that constant in a checked context could fail to trigger the required overflow panic, whereas reading it inside an unchecked block could incorrectly trigger a spurious revert. Given that these constants are fully resolved at compile time, the resulting behavior is deterministic and uninfluenced by transaction inputs, making practical exploitation unlikely outside of insufficient unit test coverage.
Notable Features and Changes
Solidity v0.8.37 also introduces important structural improvements to its experimental compilation pipelines, native support for upcoming EVM upgrades, and crucial deprecation pathways.
SSA CFG Planning Stack Shuffler (Experimental)
The experimental SSA CFG code generator, which precomputes optimal stack layouts for every instruction point within a program, has received a major architectural upgrade. Previously, the internal stack shuffler utilized a greedy algorithm, executing localized stack adjustments step-by-step until it reached the desired layout.
Version v0.8.37 replaces this greedy approach with a planning-based stack shuffler. The new mechanism constructs an explicit plan mapping current stack items to their target positions and executes the layout changes bottom-up. If an item falls out of reach for standard SWAP or DUP operations, the shuffler compresses the stack to restore reachability and recalculates the plan. Early benchmarks indicate that this structured methodology is computationally superior to the legacy greedy algorithm while maintaining comparable output bytecode sizes. The SSA CFG code generator remains experimental and can be enabled using the compiler flags --experimental --via-ssa-cfg.
Support for the SLOTNUM Opcode
Aligning with the planned Amsterdam EVM version, Solidity v0.8.37 introduces native support for the SLOTNUM opcode specified in EIP-7843. This opcode retrieves the beacon chain slot number corresponding to the current block.
Developers can access this feature within Solidity code via block.slotnum (typed as uint64), while Yul and inline assembly environments gain the built-in function slotnum(). The SMTChecker has also been updated to support this new block property. These features require compiling with --evm-version amsterdam. Beginning with the Amsterdam EVM target, slotnum is added to the list of reserved identifiers in Yul.
Removals and Deprecations
As part of the continuous effort to maintain a lean and sustainable codebase, the development team has completely removed two experimental features previously introduced in version v0.8.35: the Language Server Protocol mode (--lsp) and the Generic Solidity prototype (pragma experimental solidity). The LSP integration was incomplete and unmaintained, prompting the team to encourage standalone language server tooling that avoids tight compiler coupling. Similarly, Generic Solidity—an early prototype aimed at refactoring the compiler in place—has been superseded by solcore, an external standalone prototype better suited for architectural experimentation.
Furthermore, the experimental ABIEncoderV2 pragma now triggers a formal deprecation warning. This pragma has been redundant since version v0.7.4 introduced pragma abicoder v2 and version v0.8.0 made it the universal default. Because many older projects and legacy dependencies still reference the old pragma, the warning provides developers an opportunity to clean up their codebases before future removal. Deprecation warnings have also been extended to older EVM target versions—specifically constantinople, petersburg, istanbul, and berlin—as well as the SMTChecker’s legacy BMC engine.
How to Install and Upgrade
Developers looking to adopt Solidity v0.8.37 can access comprehensive installation instructions within the official documentation. Binary releases are available for download directly from the project’s GitHub repository.
Users building the compiler from source are advised to avoid automated source archives generated by GitHub and instead utilize the official solidity_0.8.37.tar.gz source tarball or check out the tagged v0.8.37 release via Git to ensure build integrity.






