Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix BWU compatibility #5

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sqlite3.wit
Original file line number Diff line number Diff line change
@@ -231,13 +231,15 @@
(@interface func (type 19)
arg.get 0
string.size
i32.push 1
call-core 0
arg.get 0
string.lower_memory
arg.get 1
i32.from_s32
arg.get 2
string.size
i32.push 1
call-core 0
arg.get 2
string.lower_memory
@@ -307,6 +309,7 @@
i32.from_u32
arg.get 1
string.size
i32.push 1
call-core 0
arg.get 1
string.lower_memory
@@ -349,6 +352,7 @@
i32.from_s32
arg.get 2
string.size
i32.push 1
call-core 0
arg.get 2
string.lower_memory
@@ -366,6 +370,7 @@
i32.from_u32
arg.get 1
string.size
i32.push 1
call-core 0
arg.get 1
string.lower_memory
6 changes: 5 additions & 1 deletion src/wrapper.c
Original file line number Diff line number Diff line change
@@ -8,7 +8,11 @@ int RESULT_SIZE;

cvector_vector_type(void *) OBJECTS_TO_RELEASE;

void* allocate(size_t size) {
void* allocate(size_t size, size_t _type_tag) {
if (size == 0 || size + 1 == 0) {
return 0;
}

// this +1 is needed to append then zero byte to strings passing to this module.
return malloc(size + 1);
}