|
1 | 1 | #include "openminecraft/vm/pixeltower/om_pixeltower.hpp" |
2 | | -#include "openminecraft/binary/om_bin_hash.hpp" |
3 | | -#include "openminecraft/i18n/om_i18n_res.hpp" |
4 | 2 | #include "openminecraft/log/om_log_ansi.hpp" |
5 | 3 | #include "openminecraft/log/om_log_common.hpp" |
6 | 4 | #include "openminecraft/log/om_log_threadname.hpp" |
@@ -46,16 +44,20 @@ void OMPixelTower::registerNativeFunc(std::string clazz, std::string func, std:: |
46 | 44 | } |
47 | 45 | } |
48 | 46 |
|
49 | | - throw err::OMValidationError{err::Instructions, fmt::format("registering native function to a non-native function!"), fmt::format("{}.{}{}", clazz, func, desc)}; |
| 47 | + throw err::OMValidationError{err::Instructions, |
| 48 | + fmt::format("registering native function to a non-native function!"), |
| 49 | + fmt::format("{}.{}{}", clazz, func, desc)}; |
50 | 50 | } |
51 | 51 | std::any OMPixelTower::callNativeFunc(std::string clazz, std::string func, std::string desc, std::any args) |
52 | 52 | { |
53 | 53 | auto key = fmt::format("{}.{}{}", clazz, func, desc); |
54 | | - if (nativeFuncs.count(key)) { |
| 54 | + if (nativeFuncs.count(key)) |
| 55 | + { |
55 | 56 | return nativeFuncs[key](args); |
56 | 57 | } |
57 | 58 |
|
58 | | - throw err::OMValidationError{err::Instructions, fmt::format("native function not found"), fmt::format("{}.{}{}", clazz, func, desc)}; |
| 59 | + throw err::OMValidationError{err::Instructions, fmt::format("native function not found"), |
| 60 | + fmt::format("{}.{}{}", clazz, func, desc)}; |
59 | 61 | } |
60 | 62 | void OMPixelTower::loadClass(std::shared_ptr<classfile::OMClassFile> file) |
61 | 63 | { |
@@ -93,7 +95,7 @@ std::shared_ptr<OMClass> OMPixelTower::fetchClass(std::string name) |
93 | 95 | } |
94 | 96 | void OMPixelTower::execute(std::string clazz, std::string name, std::string desc) |
95 | 97 | { |
96 | | - std::any_cast<std::shared_ptr<runtime::OMInterpreter>>(interpreter)->execute(clazz, name, desc); |
| 98 | + std::any_cast<std::shared_ptr<runtime::OMInterpreter>>(interpreter)->execute(fetchClass(clazz), name, desc); |
97 | 99 | } |
98 | 100 | void OMPixelTower::debugStackStatus() |
99 | 101 | { |
|
0 commit comments