TheDan64 / inkwell

It's a New Kind of Wrapper for Exposing LLVM (Safely)
https://thedan64.github.io/inkwell/
Apache License 2.0
2.38k stars 229 forks source link

CI segfaults on older LLVM versions #513

Closed TheDan64 closed 3 months ago

TheDan64 commented 4 months ago

CI will segfault on older LLVM versions

TheDan64 commented 4 months ago

I've narrowed it down to LLVM versions 4-9, test_values.rs test_value_from_string test

TheDan64 commented 4 months ago

This line, which makes sense:

f64_type.const_float_from_string(""). Need to see if there's some error handling from LLVM here that we're missing

TheDan64 commented 4 months ago

LLVM does not appear to notify us of errors here :/

TheDan64 commented 4 months ago

The LLVM method doesn't return a null ptr on error; the best we can do is maybe mark the wrapper as unsafe...

TheDan64 commented 4 months ago

According to https://github.com/bugsnag/llvm/blob/79a45b8b272aadab6d8259ffae19903205a19c51/lib/Support/APFloat.cpp#L2588

an assert triggers on empty string, would be easy enough to check for but not nearly enough