mirror of https://github.com/llvm/circt.git
[ImportVerilog] Fix missing return on error
Add missing `return {};` lines when operand expressions of concats fail to convert and return a null value.
This commit is contained in:
parent
2afb3cd064
commit
51a69bcd6c
|
@ -410,9 +410,9 @@ struct RvalueExprVisitor {
|
||||||
SmallVector<Value> operands;
|
SmallVector<Value> operands;
|
||||||
for (auto *operand : expr.operands()) {
|
for (auto *operand : expr.operands()) {
|
||||||
auto value = context.convertRvalueExpression(*operand);
|
auto value = context.convertRvalueExpression(*operand);
|
||||||
if (!value)
|
|
||||||
continue;
|
|
||||||
value = context.convertToSimpleBitVector(value);
|
value = context.convertToSimpleBitVector(value);
|
||||||
|
if (!value)
|
||||||
|
return {};
|
||||||
operands.push_back(value);
|
operands.push_back(value);
|
||||||
}
|
}
|
||||||
return builder.create<moore::ConcatOp>(loc, operands);
|
return builder.create<moore::ConcatOp>(loc, operands);
|
||||||
|
@ -872,12 +872,9 @@ struct RvalueExprVisitor {
|
||||||
value = context.convertRvalueExpression(*stream.operand);
|
value = context.convertRvalueExpression(*stream.operand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value = context.convertToSimpleBitVector(value);
|
||||||
if (!value)
|
if (!value)
|
||||||
return {};
|
return {};
|
||||||
value = context.convertToSimpleBitVector(value);
|
|
||||||
if (!value) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
operands.push_back(value);
|
operands.push_back(value);
|
||||||
}
|
}
|
||||||
Value value;
|
Value value;
|
||||||
|
@ -974,7 +971,7 @@ struct LvalueExprVisitor {
|
||||||
for (auto *operand : expr.operands()) {
|
for (auto *operand : expr.operands()) {
|
||||||
auto value = context.convertLvalueExpression(*operand);
|
auto value = context.convertLvalueExpression(*operand);
|
||||||
if (!value)
|
if (!value)
|
||||||
continue;
|
return {};
|
||||||
operands.push_back(value);
|
operands.push_back(value);
|
||||||
}
|
}
|
||||||
return builder.create<moore::ConcatRefOp>(loc, operands);
|
return builder.create<moore::ConcatRefOp>(loc, operands);
|
||||||
|
|
Loading…
Reference in New Issue