Skip to content

Commit 46914be

Browse files
committed
[WasmDSL] Add insist_not_null() for NChar
1 parent c0eeb0b commit 46914be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/WasmUtil.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ struct NChar : Ptr<Charx1>
5050

5151
Ptr<Charx1> val() { return *this; }
5252

53+
Ptr<Charx1> insist_not_null() {
54+
if (can_be_null())
55+
Wasm_insist(clone().not_null(), "must not be NULL");
56+
return val();
57+
}
58+
5359
Boolx1 is_null() {
5460
if (can_be_null()) {
5561
return Ptr<Charx1>::is_null();

0 commit comments

Comments
 (0)