mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fix a use of uninitialized value. OldCC is set when IsCmpZero || IsSwapped and read when ShouldUpdateCC || IsSwapped, and ShouldUpdateCC is independent. Fixes PR19932, but no test since I wasn't able to get any symptoms to appear, not even with valgrind and the testcase from the PR. It's clear what happened from inspection of the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210168 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3741,7 +3741,7 @@ optimizeCompareInstr(MachineInstr *CmpInstr, unsigned SrcReg, unsigned SrcReg2,
|
||||
continue;
|
||||
|
||||
// EFLAGS is used by this instruction.
|
||||
X86::CondCode OldCC;
|
||||
X86::CondCode OldCC = X86::COND_INVALID;
|
||||
bool OpcIsSET = false;
|
||||
if (IsCmpZero || IsSwapped) {
|
||||
// We decode the condition code from opcode.
|
||||
|
Reference in New Issue
Block a user