mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 15:02:01 -04:00
add support for non virtual states (#764)
* add support for non virtual states * typecheck go * start on virtual states * more support for virtual states * offline passes * fix tests * use behavior shortcut instead of lambda * final cleanup of virtual go * unused var warnings and fix inconsistent enum decompile order on win vs linux * fix thread safety bug with goal symbol table and vif1 interrupt handler * fix type mistake
This commit is contained in:
@@ -103,6 +103,21 @@ Function& LinkedObjectFile::get_function_at_label(int label_id) {
|
||||
/*!
|
||||
* Get the function starting at this label, or nullptr if there is none.
|
||||
*/
|
||||
Function* LinkedObjectFile::try_get_function_at_label(int label_id) {
|
||||
const auto& label = labels.at(label_id);
|
||||
return try_get_function_at_label(label);
|
||||
}
|
||||
|
||||
Function* LinkedObjectFile::try_get_function_at_label(const DecompilerLabel& label) {
|
||||
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;
|
||||
}
|
||||
|
||||
const Function* LinkedObjectFile::try_get_function_at_label(int label_id) const {
|
||||
const auto& label = labels.at(label_id);
|
||||
return try_get_function_at_label(label);
|
||||
@@ -115,7 +130,6 @@ const Function* LinkedObjectFile::try_get_function_at_label(const DecompilerLabe
|
||||
return &func;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user