Skip to content

Commit d4b52ca

Browse files
committed
fix(vm_runner): revert TRY_ASSIGN — template-arg commas break preprocessor
VMPILOT_TRY_ASSIGN(engine, VmEngine<Policy, Oram>::create(...)) doesn't expand: the comma between 'Policy' and 'Oram' inside the template argument list is visible to the C preprocessor as a macro argument separator, so the call is read as three arguments instead of two and 'engine' is never bound. Restore the three-line auto/check/deref form here; the macro is still useful in vm_engine.cpp where none of the call expressions carry a template argument list with a comma.
1 parent 895fd1f commit d4b52ca

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

runtime/src/vm_runner.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
#include "vm_runner.hpp"
88

9-
#include "cbor/strict.hpp" // for VMPILOT_TRY_ASSIGN
10-
119
namespace VMPilot::Runtime {
1210

1311
// ═════════════════════════════════════════════════════════════════════════════
@@ -56,11 +54,12 @@ template<typename Policy, typename Oram>
5654
tl::expected<VmExecResult, DiagnosticCode> VmRunner<Policy, Oram>::run() {
5755
auto blob = build_blob_internal();
5856

59-
VMPILOT_TRY_ASSIGN(engine, VmEngine<Policy, Oram>::create(
57+
auto engine = VmEngine<Policy, Oram>::create(
6058
blob.data(), blob.size(), seed_,
61-
load_base_delta_, init_regs_, num_init_regs_));
59+
load_base_delta_, init_regs_, num_init_regs_);
60+
if (!engine) return tl::make_unexpected(engine.error());
6261

63-
return engine.execute();
62+
return engine->execute();
6463
}
6564

6665
template<typename Policy, typename Oram>

0 commit comments

Comments
 (0)