Ticket #126 (closed defect: fixed)
libmjollnir CFG error
| Reported by: | pepsi601 | Owned by: | thorkill |
|---|---|---|---|
| Priority: | major | Milestone: | v0.82 |
| Component: | libmjollnir | Version: | |
| Severity: | High | Keywords: | |
| Cc: |
Description
there is an error in libmjollnir CFG module, in links.c mjr_link_block_jump function, the src block might be spited, this is not considered, so if the source and destination are in the same bloc, after the spit, the source block should be recalculated.
here is an example
suppose before the mjr_link_block_jump function, we have a basic block
1 2 3 4 and the parameter for mjr_link_block_jump is source is 4 , dst is 2 , ret is 5 so in the function, we first get the block associated with src, which starts at 1, after the spit we have two block 1 and 2 3 4 and the links added is [1] -> [2, 3, 4] [1] -> [5] which are wrong, we need to recalculate the source block, which is [2,3,4] and the right links should be [2, 3, 4] -> [2, 3,4] and [2,3,4] -> [5].
