mirror of
https://github.com/open-goal/jak-project
synced 2026-06-18 15:36:25 -04:00
[Decompiler] Clean up the output (#245)
* fix parent issue * fix compiler issue * update * add error messages * fix error * fix array access, temporary * more clean * fix * rename arg variables better * fix method name * fix no return value in decompiler * many small fixes * cheat types so it works * name map * fix old test'
This commit is contained in:
@@ -100,6 +100,21 @@ Function& LinkedObjectFile::get_function_at_label(int label_id) {
|
||||
return functions_by_seg.front().front(); // to avoid error
|
||||
}
|
||||
|
||||
/*!
|
||||
* Get the function starting at this label, or nullptr if there is none.
|
||||
*/
|
||||
const Function* LinkedObjectFile::try_get_function_at_label(int label_id) const {
|
||||
auto& label = labels.at(label_id);
|
||||
for (auto& func : functions_by_seg.at(label.target_segment)) {
|
||||
// + 4 to skip past type tag to the first word, which is were the label points.
|
||||
if (func.start_word * 4 + 4 == label.offset) {
|
||||
return &func;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Get the name of the label.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user