Commit ef751d0
Warn about bitwise shift with negative shift amount (UB in C) (#1989)
* Initial plan
* Add warnings for bitwise shift with negative shift amount (UB in C)
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/c81d432d-7783-4469-9c48-85d6bb3d1531
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
* Flatten nested match in shift_amount_negcheck for readability
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/c81d432d-7783-4469-9c48-85d6bb3d1531
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
* Use Behavior.Undefined.other category for shift-by-negative warnings
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/c81d432d-7783-4469-9c48-85d6bb3d1531
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
* Refactor shift neg check to deduplicate code; fix test to use unsigned int
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/1dec7b36-67b9-4835-abab-afb1ff9c852e
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
* Fix test: use bounded non-negative interval [0,5] instead of unsigned int top
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/daf39d5f-96e8-4887-9ade-7004d5fcc994
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
* Use ID.ge/ID.lt instead of ID.minimal/ID.maximal in check_shift_neg
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/fd400683-08ae-4a0a-b4ff-458d87ba80f8
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Co-authored-by: Michael Schwarz <michael.schwarz93@gmail.com>1 parent 63a8c09 commit ef751d0
2 files changed
Lines changed: 62 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
227 | 243 | | |
228 | 244 | | |
229 | 245 | | |
| |||
265 | 281 | | |
266 | 282 | | |
267 | 283 | | |
268 | | - | |
269 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
270 | 292 | | |
271 | 293 | | |
272 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments