[midend]修复return指令exp为空的判断条件错误
This commit is contained in:
@ -712,7 +712,7 @@ std::any SysYIRGenerator::visitReturnStmt(SysYParser::ReturnStmtContext *ctx) {
|
||||
}
|
||||
|
||||
Type* funcType = builder.getBasicBlock()->getParent()->getReturnType();
|
||||
if (funcType!= returnValue->getType() && returnValue != nullptr) {
|
||||
if (returnValue != nullptr && funcType!= returnValue->getType()) {
|
||||
ConstantValue * constValue = dynamic_cast<ConstantValue *>(returnValue);
|
||||
if (constValue != nullptr) {
|
||||
if (funcType == Type::getFloatType()) {
|
||||
|
||||
Reference in New Issue
Block a user