参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke:锁定PythonPlugin负状态短路
结论:按 LinuxCNC src/emc/pythonplugin/python_plugin.cc 的 status < PLUGIN_OK 分支,补齐 WASM PythonPlugin shim 的 call/call_method 负状态短路探针;保持 Python 执行禁用,不扩展 smoke 解析。
This commit is contained in:
@@ -58,6 +58,9 @@ int PythonPlugin::call(const char *,
|
||||
if (!callable) {
|
||||
return PLUGIN_NO_CALLABLE;
|
||||
}
|
||||
if (status < PLUGIN_OK) {
|
||||
return status;
|
||||
}
|
||||
|
||||
retval = boost::python::object();
|
||||
exception_msg = handle_pyerror();
|
||||
@@ -72,6 +75,11 @@ int PythonPlugin::run_string(const char *, boost::python::object &retval, bool)
|
||||
}
|
||||
|
||||
int PythonPlugin::call_method(boost::python::object, boost::python::object &retval) {
|
||||
// LinuxCNC source basis: src/emc/pythonplugin/python_plugin.cc returns the
|
||||
// existing negative plugin status before invoking a Python callable.
|
||||
if (status < PLUGIN_OK) {
|
||||
return status;
|
||||
}
|
||||
retval = boost::python::object();
|
||||
status = PLUGIN_OK;
|
||||
return status;
|
||||
|
||||
@@ -17,6 +17,12 @@ int main() {
|
||||
return 7;
|
||||
}
|
||||
boost::python::object retval;
|
||||
if (plugin->call(nullptr, "noop", boost::python::object(), boost::python::object(), retval) != PLUGIN_BAD_INIFILE) {
|
||||
return 14;
|
||||
}
|
||||
if (plugin->call_method(boost::python::object(), retval) != PLUGIN_BAD_INIFILE) {
|
||||
return 15;
|
||||
}
|
||||
if (plugin->run_string("noop", retval, false) != PLUGIN_OK) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user