How Does the Compiler Handle Assembly Code regarding Integer Checks?
The Solidity compiler's automatic integer overflow and underflow checks are only applied to the high-level Solidity code. When a developer uses inline assembly (Yul), they are directly writing EVM opcodes, and the compiler assumes the developer knows what they are doing.
Therefore, the compiler does not insert any automatic safety checks for arithmetic operations within assembly blocks. Developers must manually implement their own checks or ensure the logic is safe, making assembly code a high-risk area for integer vulnerabilities.