Loading
arm64/scs: Fix potential sign extension issue of advance_loc4
The expression (*opcode++ << 24) and exp * code_alignment_factor may overflow signed int and becomes negative. Fix this by casting each byte to u64 before shifting. Also fix the misaligned break statement while we are here. Example of the result can be seen here: Link: https://godbolt.org/z/zhY8d3595 It maybe not a real problem, but could be a issue in future. Fixes: d499e962 ("arm64/scs: Fix handling of advance_loc4") Signed-off-by:Wentao Guan <guanwentao@uniontech.com> Signed-off-by:
Catalin Marinas <catalin.marinas@arm.com>