There are following issues with CFIProgram::parse code:
- Invalid CFI opcodes were never tested. And currently a test would fail
when the LLVM_ENABLE_ABI_BREAKING_CHECKS is enabled. It happens because
the DataExtractor::Cursor C remains unchecked when the
"Invalid extended CFI opcode" error is reported:
.eh_frame section at offset 0x1128 address 0x0: Program aborted due to an unhandled Error: Error value was Success. (Note: Success values must still be checked prior to being destroyed).
- It is impossible to reach the "Invalid primary CFI opcode" error with the current code.
There are 3 possible primary opcode values and all of them are handled. Hence this error
should be replaced with llvm_unreachable.
- Errors currently reported are upper-case.
This patch refines the code in the CFIProgram::parse method to fix all issues mentioned
and adds unit tests for all possible invalid extended CFI opcodes.
parseCFI