Reduce complexity of 'if' nesting

This commit is contained in:
Serge Lamikhov-Center 2022-06-11 05:59:51 +00:00 committed by GitHub
parent f1c7d420e4
commit cfa213d646
2 changed files with 12 additions and 12 deletions

View File

@ -97,5 +97,6 @@
] ]
}, },
"gtest-adapter.debugConfig": "Run ELFIO Tests", "gtest-adapter.debugConfig": "Run ELFIO Tests",
"gtest-adapter.supportLocation": true "gtest-adapter.supportLocation": true,
"sonarlint.pathToCompileCommands": "${workspaceFolder}/build/compile_commands.json"
} }

View File

@ -305,16 +305,15 @@ class elfio
&& ( a->get_size() > 0 ) && ( a->get_size() > 0 )
&& ( b->get_size() > 0 ) && ( b->get_size() > 0 )
&& ( a->get_offset() > 0 ) && ( a->get_offset() > 0 )
&& (b->get_offset() > 0)) { && ( b->get_offset() > 0 )
if ( is_offset_in_section( a->get_offset(), b ) && ( is_offset_in_section( a->get_offset(), b )
|| is_offset_in_section( a->get_offset()+a->get_size()-1, b ) || is_offset_in_section( a->get_offset()+a->get_size()-1, b )
|| is_offset_in_section( b->get_offset(), a ) || is_offset_in_section( b->get_offset(), a )
|| is_offset_in_section( b->get_offset()+b->get_size()-1, a )) { || is_offset_in_section( b->get_offset()+b->get_size()-1, a ) ) ) {
errors += "Sections " + a->get_name() + " and " + b->get_name() + " overlap in file\n"; errors += "Sections " + a->get_name() + " and " + b->get_name() + " overlap in file\n";
} }
} }
} }
}
// Check for conflicting section / program header tables, where // Check for conflicting section / program header tables, where
// the same offset has different vaddresses in section table and // the same offset has different vaddresses in section table and