about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2016-12-29 16:55:29 +0100
committerRobin Kruppe <robin.kruppe@gmail.com>2016-12-29 21:10:03 +0100
commit8d50857a6fd38669d85d85ba5172c6262430f4af (patch)
treeab08a5ac1dc2416adfb1b15f4865034278f683d8 /src/rustllvm/RustWrapper.cpp
parentc74ac6cb97ae77429258c3bff2938714f6a329ca (diff)
downloadrust-8d50857a6fd38669d85d85ba5172c6262430f4af.tar.gz
rust-8d50857a6fd38669d85d85ba5172c6262430f4af.zip
Check *all* errors in LLVMRustArchiveIterator* API
Incrementing the `Archive::child_iterator` fetches and validates the next child.
This can trigger an error, which we previously checked on the *next* call to `LLVMRustArchiveIteratorNext()`.
This means we ignore the last error if we stop iterating halfway through.
This is harmless (we don't access the child, after all) but LLVM 4.0 calls `abort()` if *any* error goes unchecked, even a success value.
This means that basically any rustc invocation that opens an archive and searches through it would die.

The solution implemented here is to change the order of operations, such that
advancing the iterator and fetching the newly-validated iterator happens in the same `Next()` call.
This keeps the error handling behavior as before but ensures all `Error`s get checked.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions