Commit d298bd3e authored by Yang's avatar Yang

fix lab2 bug

parent 52615882
......@@ -156,7 +156,8 @@ void Function::check_for_block_relation_error()
}
}
// 检查基本块的前驱和后继表不包含重复的基本块
for (auto& bb : basic_blocks_)
/*
for (auto& bb : basic_blocks_)
{
bbs.clear();
for(auto suc: bb.get_succ_basic_blocks()){
......@@ -168,6 +169,7 @@ void Function::check_for_block_relation_error()
bbs.emplace(suc);
}
}
*/
// 检查基本块基本信息
for (auto& bb : basic_blocks_)
{
......@@ -197,7 +199,7 @@ void Function::check_for_block_relation_error()
for(auto i : suc_table) {
bool ok = false;
for(auto j : i->get_pre_basic_blocks()) {
if(j == i){
if(j == &bb){
ok = true;
break;
}
......
......@@ -76,7 +76,7 @@ lv1 = {
"transfer_int_to_float": (1, False),
}
# 23
# 24
lv2 = {
"funcall_chain": (2, False),
"assign_chain": (2, False),
......@@ -86,16 +86,17 @@ lv2 = {
"funcall_array_array": (2, False),
"return_in_middle1": (2, False),
"return_in_middle2": (2, False),
"funcall_type_mismatch1": (2, False),
"funcall_type_mismatch2": (2, False),
"funcall_type_mismatch1": (1.5, False),
"funcall_type_mismatch2": (1.5, False),
"return_type_mismatch1": (1.5, False),
"return_type_mismatch2": (1.5, False),
"alloca_in_loop": (2, False)
}
# 11
# 10
lv3 = {
"complex1": (3, False),
"complex2": (3, True),
"complex1": (2.5, False),
"complex2": (2.5, True),
"complex3": (2, True),
"complex4": (3, False),
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment