mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-16 08:08:01 +00:00
fix a crash in SCCP handling extractvalue of an array, pointed out and
tracked down by Stephan Reiter! llvm-svn: 86726
This commit is contained in:
parent
b92c9347ba
commit
a163be92fc
@ -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…
Reference in New Issue
Block a user