参考所有分组,完成尽量多的内容。禁止顺手扩功能 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:
@@ -33,6 +33,7 @@ grep -F 'print_rcs_error_new' "$linuxcnc_root/src/libnml/rcs/rcs_print.cc" >/dev
|
|||||||
grep -F 'rtapi_snprintf' "$linuxcnc_root/src/rtapi/uspace_common.h" >/dev/null
|
grep -F 'rtapi_snprintf' "$linuxcnc_root/src/rtapi/uspace_common.h" >/dev/null
|
||||||
grep -F 'class PythonPlugin' "$linuxcnc_root/src/emc/pythonplugin/python_plugin.hh" >/dev/null
|
grep -F 'class PythonPlugin' "$linuxcnc_root/src/emc/pythonplugin/python_plugin.hh" >/dev/null
|
||||||
grep -F 'PythonPlugin::instantiate' "$linuxcnc_root/src/emc/pythonplugin/python_plugin.cc" >/dev/null
|
grep -F 'PythonPlugin::instantiate' "$linuxcnc_root/src/emc/pythonplugin/python_plugin.cc" >/dev/null
|
||||||
|
grep -F 'if (status < PLUGIN_OK)' "$linuxcnc_root/src/emc/pythonplugin/python_plugin.cc" >/dev/null
|
||||||
grep -F '#define TOOL_MMAP_FILENAME ".tool.mmap"' "$linuxcnc_root/src/emc/tooldata/tooldata_mmap.cc" >/dev/null
|
grep -F '#define TOOL_MMAP_FILENAME ".tool.mmap"' "$linuxcnc_root/src/emc/tooldata/tooldata_mmap.cc" >/dev/null
|
||||||
grep -F 'int tool_nml_register(CANON_TOOL_TABLE *tblptr)' "$linuxcnc_root/src/emc/tooldata/tooldata_nml.cc" >/dev/null
|
grep -F 'int tool_nml_register(CANON_TOOL_TABLE *tblptr)' "$linuxcnc_root/src/emc/tooldata/tooldata_nml.cc" >/dev/null
|
||||||
grep -F 'int tooldata_db_init(char progname_plus_args[]' "$linuxcnc_root/src/emc/tooldata/tooldata_db.cc" >/dev/null
|
grep -F 'int tooldata_db_init(char progname_plus_args[]' "$linuxcnc_root/src/emc/tooldata/tooldata_db.cc" >/dev/null
|
||||||
@@ -118,6 +119,7 @@ for phrase in [
|
|||||||
"RS274/WASM manifest",
|
"RS274/WASM manifest",
|
||||||
"browser-safe LinuxCNC adaptations",
|
"browser-safe LinuxCNC adaptations",
|
||||||
"inactive-DB return values",
|
"inactive-DB return values",
|
||||||
|
"negative-status short-circuit behavior",
|
||||||
]:
|
]:
|
||||||
if phrase not in source_map:
|
if phrase not in source_map:
|
||||||
raise SystemExit(f"docs/linuxcnc-wasm-shims-source-map.md missing boundary phrase: {phrase}")
|
raise SystemExit(f"docs/linuxcnc-wasm-shims-source-map.md missing boundary phrase: {phrase}")
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ int PythonPlugin::call(const char *,
|
|||||||
if (!callable) {
|
if (!callable) {
|
||||||
return PLUGIN_NO_CALLABLE;
|
return PLUGIN_NO_CALLABLE;
|
||||||
}
|
}
|
||||||
|
if (status < PLUGIN_OK) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
retval = boost::python::object();
|
retval = boost::python::object();
|
||||||
exception_msg = handle_pyerror();
|
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) {
|
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();
|
retval = boost::python::object();
|
||||||
status = PLUGIN_OK;
|
status = PLUGIN_OK;
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -17,6 +17,12 @@ int main() {
|
|||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
boost::python::object retval;
|
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) {
|
if (plugin->run_string("noop", retval, false) != PLUGIN_OK) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ only; it must not add CNC behavior and must not expand the temporary smoke parse
|
|||||||
| `core/wasm_shims/rtapi_compat.cc` | `src/rtapi/uspace_common.h`, `src/rtapi/rtapi.h` | Provides userspace RTAPI formatting declarations used by RS274/NML code. |
|
| `core/wasm_shims/rtapi_compat.cc` | `src/rtapi/uspace_common.h`, `src/rtapi/rtapi.h` | Provides userspace RTAPI formatting declarations used by RS274/NML code. |
|
||||||
| `core/wasm_shims/tooldata/tooldata_mmap_backend.cc` | `src/emc/tooldata/tooldata_mmap.cc` | Replaces native mmap storage with an in-memory WASM-safe backend for probes. |
|
| `core/wasm_shims/tooldata/tooldata_mmap_backend.cc` | `src/emc/tooldata/tooldata_mmap.cc` | Replaces native mmap storage with an in-memory WASM-safe backend for probes. |
|
||||||
| `core/wasm_shims/tooldata/tooldata_runtime_stubs.cc` | `src/emc/tooldata/tooldata_nml.cc`, `src/emc/tooldata/tooldata_db.cc` | Satisfies NML and external tool database entry points without native services, preserving inactive-DB return values. |
|
| `core/wasm_shims/tooldata/tooldata_runtime_stubs.cc` | `src/emc/tooldata/tooldata_nml.cc`, `src/emc/tooldata/tooldata_db.cc` | Satisfies NML and external tool database entry points without native services, preserving inactive-DB return values. |
|
||||||
| `core/wasm_shims/pythonplugin/python_plugin.cc` | `src/emc/pythonplugin/python_plugin.cc`, `src/emc/pythonplugin/python_plugin.hh` | Keeps LinuxCNC PythonPlugin API available while Python execution is disabled for browser-safe probes. |
|
| `core/wasm_shims/pythonplugin/python_plugin.cc` | `src/emc/pythonplugin/python_plugin.cc`, `src/emc/pythonplugin/python_plugin.hh` | Keeps LinuxCNC PythonPlugin API and negative-status short-circuit behavior available while Python execution is disabled for browser-safe probes. |
|
||||||
|
|
||||||
## Boundaries
|
## Boundaries
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user