Write output only after successful compilation
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- build-system
調査の方向性
compiler/main.cppから始め、アセンブリの検証と最後の書き込みに対して、出力ストリームがどの時点で開かれるかを追ってください。コンパイラの既存の検証経路と、失敗の報告方法を確認してください。検証が成功するまで出力の作成を遅らせ、無効な入力では既存の出力が変更されず、コンパイルが成功した場合は期待される出力が書き込まれることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
The compiler opens the output file before it has finished validating the assembly and before it knows whether the program is valid.
Problem
If parsing fails, the program may leave an existing output file partially or incorrectly initialized, even though no successful compilation happened.
Expected behavior
- Validate the entire source before opening or writing the output file.
- Keep the output file closed until a successful compile is confirmed.
- Prefer a temp-file-and-rename strategy for safer writes.
Relevant code
compiler/main.cppwhere the output stream is created before validation completes.
Suggested fix
Move std::ofstream output_file(output); to just before the final write, after all validation passes. Use a temporary output path and rename it on success if atomic updates are important.
- 主要言語
- C++
- スター
- 0
- フォーク
- 0
- 平均マージ
- 1分
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DavidSkillman/LittleManCompiler のほかの issue
-
bug copilot
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug compiler copilot good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
DavidSkillman/LittleManCompiler の issue をすべて見る
似ている issue
-
help wanted new command
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tldr-pages/tldr#25111 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug test
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
OpenAssetIO/OpenAssetIO#1527 ·
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primary対応中かも @alleneubank が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
react/react-native#59919 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
ROCm/rocm-systems#15475 ·
メンテナーはふだん 2 日以内に返信