CVE-2024-31852: Llvm Local Calleesavedinfo Clear

Unconditionally clearing the 'Restored' flag of a register in CalleeSavedInfo during local block optimization can lead to miscompilation. CalleeSavedInfo represents global function state; modifying it locally without verifying all function paths (e.g., other return blocks) may cause registers to be left unrestored, leading to control-flow errors or crashes.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0C++β
greprules fetch cve-2024-31852-llvm-local-calleesavedinfo-clear --engine opengrep

Description

Unconditionally clearing the 'Restored' flag of a register in CalleeSavedInfo during local block optimization can lead to miscompilation. CalleeSavedInfo represents global function state; modifying it locally without verifying all function paths (e.g., other return blocks) may cause registers to be left unrestored, leading to control-flow errors or crashes.