Skip to content

Commit ecb5cfe

Browse files
committed
Address review: keep addend32 as uint32, sign-extend via cast
1 parent ff98ef5 commit ecb5cfe

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

core/iwasm/aot/aot_loader.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,12 +3868,11 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
38683868
read_uint64(buf, buf_end, relocation->relocation_addend);
38693869
}
38703870
else {
3871-
uint32 offset32;
3872-
int32 addend32;
3871+
uint32 offset32, addend32;
38733872
read_uint32(buf, buf_end, offset32);
38743873
relocation->relocation_offset = (uint64)offset32;
38753874
read_uint32(buf, buf_end, addend32);
3876-
relocation->relocation_addend = (int64)addend32;
3875+
relocation->relocation_addend = (int64)(int32)addend32;
38773876
}
38783877
read_uint32(buf, buf_end, relocation->relocation_type);
38793878
read_uint32(buf, buf_end, symbol_index);

0 commit comments

Comments
 (0)