Skip to content

Conversation

Gaelan
Copy link
Contributor

@Gaelan Gaelan commented Apr 28, 2020

LLVM 10's UBSAN catches several cases of undefined behavior when running the test suite:

  • jv_get cast array indices to an int, even if the index is out of range. I added a bounds check.
  • Several places do pointer math on null pointers, which is undefined behavior. I fixed this by special casing null.

Additionally, I added -fno-sanitize-recover=undefined to the CFLAGS, which is necessary to make UBSAN actually crash the program (and therefore fail the tests) instead of just logging an error.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 84.139% when pulling 5dc92fe on Gaelan:llvm10-ubsan into ccc79e5 on stedolan:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants