From f8b43ed0a901eb7867a5519c4d0ea231f68b3409 Mon Sep 17 00:00:00 2001 From: James Ring Date: Tue, 27 May 2025 09:59:27 -0700 Subject: [PATCH] Add wabt::Const::set_funcref(uintptr_t) overload This allows wabt::Const funcrefs to be created from bits read from other sources, e.g. a WASM engine under test. --- include/wabt/ir.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/wabt/ir.h b/include/wabt/ir.h index 5fa4439a0..7a27740ae 100644 --- a/include/wabt/ir.h +++ b/include/wabt/ir.h @@ -154,6 +154,7 @@ struct Const { set_expected_nan(0, nan); } void set_funcref() { From(Type::FuncRef, 0); } + void set_funcref(uintptr_t x) { From(Type::FuncRef, x); } void set_externref(uintptr_t x) { From(Type::ExternRef, x); } void set_null(Type type) { From(type, kRefNullBits); }