Ambiguous warning when a workflow makes a bad modification to MLIL
Version and Platform (required):
- Binary Ninja Version: 5.3.8707-dev Ultimate (a74ed668)
- Edition: Ultimate
- OS: macOS
- OS Version: 15.6
- CPU Architecture: M1
Bug Description: I have a function workflow activity thats removing instructions in MLIL. Previously it was working fine and then I made some changes and now I'm getting lots of the following warning:
[Default warn] Cannot find the source block of mlil@7 in function <address>. Did you forget to call MarkLabel() during lifting?
The problem with the warning is that it always says mlil@7 no matter what function it states the issue occurred in. Also I've gone to some of the functions it warns about and toggled the function workflow on and off for that function and for some of those functions the warning will be printed when I toggle the workflow back on but for some it won't. So I'm not convinced its even reporting for the correct functions. What also makes me feel this way is that I appear to be making valid changes (by comparing the before and after changes) to the function and I'm using the documented way of removing instructions.
Expected Behavior: It's likely that my plugin workflow is doing something wrong but I think the warning information is also incorrect. At least it doesn't appear to make any sense.
On further analysis I can confirm I was removing a basic block that still had if statements trying to reach it but the warning itself does not appear to be providing accurate information to help diagnose the problem.
Another confusing example:
[Default warn] Cannot find the source block of mlil@0 in function 0x18cdffe70. Did you forget to call MarkLabel() during lifting?
I didn't know the first instruction or first block of a function had a source block. Very confused about what this is trying to tell me. (The function in question only has one basic block).