fix(simu): use local time rather than UTC in the WASM simulator (#7658)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Peter Feerick
2026-08-18 19:37:31 +10:00
committed by GitHub
co-authored by Claude Opus 5
parent 3e1e1859bc
commit e9a6ab8691
6 changed files with 70 additions and 23 deletions
@@ -15,6 +15,7 @@
#include "wasmsimulatorinterface.h"
#include <QDateTime>
#include <QDebug>
#include <QFile>
#include <QElapsedTimer>
@@ -559,8 +560,11 @@ void WasmSimulatorInterface::start(const char * filename, bool tests)
}
}
uint32_t argv[1] = {(uint32_t)tests};
if (!wasm_runtime_call_wasm(m_execEnv, m_fnStart, 1, argv)) {
// WASI has no timezone support, so the module needs our UTC offset.
uint32_t argv[2] = {
(uint32_t)tests,
(uint32_t)(int32_t)QDateTime::currentDateTime().offsetFromUtc()};
if (!wasm_runtime_call_wasm(m_execEnv, m_fnStart, 2, argv)) {
qWarning() << "WASM simuStart failed:"
<< wasm_runtime_get_exception(m_moduleInst);
return;