Skip to content

Commit 27b4e7d

Browse files
fix(sw-macro): host set_up_once undefined (openvm-org#1717)
When the `sw-macro` generated struct is compiled for host (`target_os != "zkvm"`), there is no `set_up_once()` function. Apparently the compiler didn't catch this and the trait implementation of `fn set_up_once { Self::set_up_once() }` becomes an infinite loop.
1 parent 7d63ca9 commit 27b4e7d

File tree

1 file changed

+5
-0
lines changed
  • extensions/ecc/sw-macros/src

1 file changed

+5
-0
lines changed

extensions/ecc/sw-macros/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ pub fn sw_declare(input: TokenStream) -> TokenStream {
202202
});
203203
}
204204

205+
#[cfg(not(target_os = "zkvm"))]
206+
fn set_up_once() {
207+
// No-op for non-ZKVM targets
208+
}
209+
205210
fn is_identity_impl<const CHECK_SETUP: bool>(&self) -> bool {
206211
use openvm_algebra_guest::IntMod;
207212
// Safety: Self::set_up_once() ensures IntMod::set_up_once() has been called.

0 commit comments

Comments
 (0)