Skip to content

Commit

Permalink
Merge pull request #5 from fluencelabs/fix_bwu
Browse files Browse the repository at this point in the history
fix BWU compatibility
  • Loading branch information
mikevoronov authored Sep 3, 2021
2 parents e7c772c + 5b93249 commit 19d85ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions sqlite3.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -307,6 +309,7 @@
i32.from_u32
arg.get 1
string.size
i32.push 1
call-core 0
arg.get 1
string.lower_memory
Expand Down Expand Up @@ -349,6 +352,7 @@
i32.from_s32
arg.get 2
string.size
i32.push 1
call-core 0
arg.get 2
string.lower_memory
Expand All @@ -366,6 +370,7 @@
i32.from_u32
arg.get 1
string.size
i32.push 1
call-core 0
arg.get 1
string.lower_memory
Expand Down
6 changes: 5 additions & 1 deletion src/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 19d85ba

Please sign in to comment.