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:
water111
2021-08-17 20:54:03 -04:00
committed by GitHub
parent 2dfb2b2545
commit 97ab6a4e12
76 changed files with 7111 additions and 7828 deletions
+15 -1
View File
@@ -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;
}