[Bug] Declare recovered internal functions before call sites
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
Start with the function emission loop in src/decompiler/project.cpp (lines 316-337) and the call emission in src/decompiler/decompiler.cpp (lines 558-590), then check how analysis.functions is used to name callees. Save the issue's reproducer as C, decompile it, and compile the output with gcc -std=c11 -Wall -Wextra -Werror to see the implicit-declaration error. Done means the reproducer compiles cleanly, and forward and mutually recursive calls also compile with matching prototypes and static linkage.
索引モデルが issue の本文から書いたものです。
説明
Summary
Generated C-like output calls recovered internal functions before declaring them. When a caller is located before its callee in the binary, the generated source fails under C11 with -Werror.
Evidence
src/decompiler/project.cpp:316-337 emits recovered function definitions in analysis/address order, while src/decompiler/decompiler.cpp:558-590 emits calls using the recovered callee name. No forward declarations are emitted for functions in analysis.functions.
Reproducer:
int callee(int);
__attribute__((noinline)) int caller(int x) { return callee(x); }
__attribute__((noinline)) int callee(int x) { return x; }
int main(void) { return caller(0); }
After compiling at -O0 -g, decompiling, and compiling the recovered source with gcc -std=c11 -Wall -Wextra -Werror, GCC reports:
error: implicit declaration of function ‘callee’
error: static declaration of ‘callee’ follows non-static declaration
Impact
Whether recovered output compiles depends on the link/order layout of functions. Forward calls, mutually recursive functions, and some stripped binaries fail even when the underlying recovered call is otherwise representable.
Expected behavior
The renderer should emit a consistent prototype for every recovered internal function before any function body, or otherwise order declarations safely while preserving recursion and the static linkage used by generated definitions.
Acceptance criteria
- The reproducer compiles with
-std=c11 -Wall -Wextra -Werror. - Forward calls and recursive/mutually recursive calls do not produce implicit-declaration or linkage-conflict diagnostics.
- Prototypes use the same generated identifiers and compatible parameter/return types as their definitions.
- 主要言語
- C++
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TiElixir/caraxes のほかの issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
bug good first issue
難易度 3/5 半日 初心者へのやさしさ 68/100
TiElixir/caraxes の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
std::fdim drops partial derivative w.r.t second argument in forward and reverse mode対応中かも @ADITYASINGH1206 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
vgvassilev/clad#2534 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信