Skip to content

Commit 91bcf94

Browse files
HerrCai0907atc-github
authored andcommitted
fix: load opcode will trigger Implement Limitation on TRICORE (#697)
1 parent e8d6b76 commit 91bcf94

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

RELEASENOTES.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Wasm Compiler Release Notes
22

3+
## 3.0.4
4+
5+
- Fixed the problem that load opcode will trigger Implement Limitation on TRICORE.
6+
37
## 3.0.3
4-
Add u32 and u64 type to WasmValue
8+
9+
- Add u32 and u64 type to WasmValue
510

611
## 3.0.2
712

813
### Feature
14+
915
- Add version number to checking to binary module
1016

1117
### Bug Fixes

src/core/common/VbExceptions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ RuntimeError::operator const char *() const VB_NOEXCEPT {
4848
case (Code::Conditional_branches_or_lea_can_only_target_offsets_in_the_range___32kB): {
4949
return "Conditional branches or LEA can only target offsets in the range +-32kB";
5050
}
51+
case Code::Conditional_branches_can_only_target_offsets_in_the_range_32B: {
52+
return "Conditional branches can only target offsets in the range +32B";
53+
}
5154
case (Code::Branches_can_only_target_offsets_in_the_range___16MB): {
5255
return "Branches can only target offsets in the range +-16MB";
5356
}

src/core/common/VbExceptions.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class RuntimeError : public std::exception {
4141
Small_branches_can_only_target_unsigned_offsets_in_the_range___32B,
4242
Branches_can_only_target_offsets_in_the_range___128MB,
4343
Conditional_branches_or_lea_can_only_target_offsets_in_the_range___32kB,
44+
Conditional_branches_can_only_target_offsets_in_the_range_32B,
4445
Branches_can_only_target_offsets_in_the_range___16MB,
4546
Maximum_offset_reached,
4647
BrHANDLE_ERRORanches_can_only_maximally_target_32_bit_signed_offsets,

src/core/compiler/backend/tricore/tricore_relpatchobj.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ void RelPatchObj::linkToBinaryPos(uint32_t const binaryPosition) const {
6262
assert(isBranch_ && "Must be branch");
6363
// Only disp4zx2 can be encoded
6464
UnsignedInRangeCheck<5U> const rangeCheck{UnsignedInRangeCheck<5U>::check(static_cast<uint32_t>(delta))};
65-
if ((delta < 0) || (!in_range<5>(delta))) {
66-
throw ImplementationLimitationException(ErrorCode::Conditional_branches_or_lea_can_only_target_offsets_in_the_range___32kB);
65+
if (!rangeCheck.inRange()) {
66+
throw ImplementationLimitationException(ErrorCode::Conditional_branches_can_only_target_offsets_in_the_range_32B);
6767
}
6868
static_cast<void>(instruction.setDisp4zx2(rangeCheck.safeInt()));
6969
return;

0 commit comments

Comments
 (0)