Commit fa09871
MarcoFalke
refactor: Avoid sign-compare compiler warning in util/asmap
This reverts commit eac6a30 ("refactor:
Rework asmap Interpret to avoid ptrdiff_t"), because it is UB to form a
past-the-end iterator, even if it is never dereferenced.
Then fix the compiler warning in a different way:
Instead of comparing an uint32_t against a signed ptrdiff_t, just
promote both to a type that can represent both types.
Even though in this case the ptrdiff_t should never hold a negative
value, the overhead from promotion should be negligible.1 parent fb66dbe commit fa09871
1 file changed
+2
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
| 96 | + | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | | - | |
160 | | - | |
| 158 | + | |
161 | 159 | | |
162 | 160 | | |
163 | 161 | | |
| |||
0 commit comments