mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 20:34:38 +00:00
fix a crash in SCCP handling extractvalue of an array, pointed out and
tracked down by Stephan Reiter! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f235f13931
commit
103f2434b8
@ -795,9 +795,14 @@ void SCCPSolver::visitExtractValueInst(ExtractValueInst &EVI) {
|
||||
return markOverdefined(&EVI);
|
||||
|
||||
Value *AggVal = EVI.getAggregateOperand();
|
||||
unsigned i = *EVI.idx_begin();
|
||||
LatticeVal EltVal = getStructValueState(AggVal, i);
|
||||
mergeInValue(getValueState(&EVI), &EVI, EltVal);
|
||||
if (isa<StructType>(AggVal->getType())) {
|
||||
unsigned i = *EVI.idx_begin();
|
||||
LatticeVal EltVal = getStructValueState(AggVal, i);
|
||||
mergeInValue(getValueState(&EVI), &EVI, EltVal);
|
||||
} else {
|
||||
// Otherwise, must be extracting from an array.
|
||||
return markOverdefined(&EVI);
|
||||
}
|
||||
}
|
||||
|
||||
void SCCPSolver::visitInsertValueInst(InsertValueInst &IVI) {
|
||||
|
@ -22,3 +22,8 @@ bb34:
|
||||
return:
|
||||
ret void
|
||||
}
|
||||
|
||||
define i32 @test2([4 x i32] %A) {
|
||||
%B = extractvalue [4 x i32] %A, 1
|
||||
ret i32 %B
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user