Skip to content

Commit 7850d17

Browse files
committed
fix wamr
1 parent 7288fa8 commit 7850d17

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wamr/wamr.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ bool Wamr::load(std::string_view bytecode, std::string_view precompiled,
129129
wasm_byte_vec_t binary = {0};
130130
if (precompiled.empty()) {
131131
binary.size = bytecode.size();
132-
binary.data = static_cast<char *> bytecode.data();
132+
binary.data = const_cast<char *>(bytecode.data());
133133
binary.num_elems = bytecode.size();
134134
binary.size_of_elem = sizeof(byte_t);
135135
binary.lock = nullptr;
136136
} else {
137137
// skip leading paddings
138-
uint8_t padding_count = static_cast<uint8_t> precompiled[0];
138+
uint8_t padding_count = static_cast<uint8_t>(precompiled[0]);
139139
precompiled.remove_prefix(padding_count + 1);
140140

141141
binary.size = precompiled.size();
142-
binary.data = static_cast<char *> precompiled.data();
142+
binary.data = const_cast<char *>(precompiled.data());
143143
binary.num_elems = precompiled.size();
144144
binary.size_of_elem = sizeof(byte_t);
145145
binary.lock = nullptr;
@@ -239,8 +239,8 @@ static const char *printValKind(wasm_valkind_t kind) {
239239
return "f32";
240240
case WASM_F64:
241241
return "f64";
242-
case WASM_EXTERNREF:
243-
return "externref";
242+
case WASM_ANYREF:
243+
return "anyref";
244244
case WASM_FUNCREF:
245245
return "funcref";
246246
default:

0 commit comments

Comments
 (0)