avast / avast/retdec

retdec-inst-opt pass optimization and i1 x,y instruction error

Open
#943 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
8.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/avast/retdec/blob/dca4d73f5cd8112c8a8d66a8c36c19bbc79d7bfb/src/bin2llvmir/optimizations/inst_opt/inst_opt.cpp#L296-L324
It can be optimized only when **x == y == 1**, and you will get wrong results when **x == y == 0**

Contributor guide

No contributing guide indexed for this repository

Research direction

Read src/bin2llvmir/optimizations/inst_opt/inst_opt.cpp around lines 296-324 and trace the i1 x,y instruction handling. Check the optimization assumptions for x == y == 1 and x == y == 0; done means the pass optimizes only the valid case and no longer produces wrong results for the zero case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, reverse-engineering
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.