Commit 996758c
authored
Remove the dlen to optimize it. (#4193)
There are two reasons for this optimization:
- The value of dlen can equal 0x1_0000_0000, even in wasm32 mode, because it is derived from (4G-0). This results in a truncation when it is passed to b_memmove_s(). Consequently, s1max becomes 0 and n is greater than s1max. To correct this, a longer type is required.
- The dlen is only used to check if there is enough space in b_memmove_s(). However, from a different angle, after confirming that both src+len and dst+len are within the memory range, we can be assured and there is no need for this explicit check.1 parent fc1527e commit 996758c
File tree
2 files changed
+33
-29
lines changed- core/iwasm/interpreter
2 files changed
+33
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5784 | 5784 | | |
5785 | 5785 | | |
5786 | 5786 | | |
5787 | | - | |
5788 | 5787 | | |
5789 | 5788 | | |
5790 | 5789 | | |
| |||
5797 | 5796 | | |
5798 | 5797 | | |
5799 | 5798 | | |
| 5799 | + | |
5800 | 5800 | | |
5801 | 5801 | | |
5802 | 5802 | | |
5803 | | - | |
5804 | | - | |
5805 | | - | |
5806 | 5803 | | |
5807 | 5804 | | |
5808 | 5805 | | |
5809 | | - | |
5810 | | - | |
5811 | | - | |
5812 | | - | |
5813 | 5806 | | |
5814 | 5807 | | |
5815 | 5808 | | |
5816 | 5809 | | |
5817 | | - | |
5818 | 5810 | | |
5819 | 5811 | | |
5820 | 5812 | | |
| |||
5832 | 5824 | | |
5833 | 5825 | | |
5834 | 5826 | | |
| 5827 | + | |
5835 | 5828 | | |
5836 | 5829 | | |
5837 | 5830 | | |
| |||
5851 | 5844 | | |
5852 | 5845 | | |
5853 | 5846 | | |
5854 | | - | |
5855 | | - | |
5856 | | - | |
5857 | | - | |
5858 | | - | |
5859 | | - | |
5860 | | - | |
5861 | | - | |
5862 | | - | |
| 5847 | + | |
| 5848 | + | |
| 5849 | + | |
| 5850 | + | |
| 5851 | + | |
| 5852 | + | |
| 5853 | + | |
| 5854 | + | |
| 5855 | + | |
| 5856 | + | |
| 5857 | + | |
| 5858 | + | |
| 5859 | + | |
| 5860 | + | |
| 5861 | + | |
5863 | 5862 | | |
5864 | 5863 | | |
5865 | 5864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5163 | 5163 | | |
5164 | 5164 | | |
5165 | 5165 | | |
5166 | | - | |
5167 | 5166 | | |
5168 | 5167 | | |
5169 | 5168 | | |
| |||
5173 | 5172 | | |
5174 | 5173 | | |
5175 | 5174 | | |
5176 | | - | |
5177 | | - | |
5178 | 5175 | | |
5179 | 5176 | | |
5180 | 5177 | | |
5181 | | - | |
5182 | | - | |
5183 | | - | |
5184 | | - | |
5185 | 5178 | | |
5186 | 5179 | | |
5187 | 5180 | | |
| |||
5197 | 5190 | | |
5198 | 5191 | | |
5199 | 5192 | | |
5200 | | - | |
5201 | 5193 | | |
5202 | 5194 | | |
5203 | 5195 | | |
| |||
5208 | 5200 | | |
5209 | 5201 | | |
5210 | 5202 | | |
5211 | | - | |
5212 | | - | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
5213 | 5218 | | |
5214 | 5219 | | |
5215 | 5220 | | |
| |||
7488 | 7493 | | |
7489 | 7494 | | |
7490 | 7495 | | |
7491 | | - | |
| 7496 | + | |
7492 | 7497 | | |
7493 | 7498 | | |
7494 | 7499 | | |
| |||
0 commit comments