File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ LLVMRustDestroyArchive(RustArchive *ar) {
7373struct RustArchiveIterator {
7474 Archive::child_iterator cur;
7575 Archive::child_iterator end;
76+ #if LLVM_VERSION_MINOR >= 9
77+ Error err;
78+ #endif
7679};
7780
7881extern " C" RustArchiveIterator*
@@ -82,15 +85,24 @@ LLVMRustArchiveIteratorNew(RustArchive *ra) {
8285#if LLVM_VERSION_MINOR <= 8
8386 rai->cur = ar->child_begin ();
8487#else
85- Error err;
86- rai->cur = ar->child_begin (err);
88+ rai->cur = ar->child_begin (rai->err );
89+ if (rai->err ) {
90+ LLVMRustSetLastError (toString (std::move (rai->err )).c_str ());
91+ return NULL ;
92+ }
8793#endif
8894 rai->end = ar->child_end ();
8995 return rai;
9096}
9197
9298extern " C" const Archive::Child*
9399LLVMRustArchiveIteratorNext (RustArchiveIterator *rai) {
100+ #if LLVM_VERSION_MINOR >= 9
101+ if (rai->err ) {
102+ LLVMRustSetLastError (toString (std::move (rai->err )).c_str ());
103+ return NULL ;
104+ }
105+ #endif
94106 if (rai->cur == rai->end )
95107 return NULL ;
96108#if LLVM_VERSION_MINOR == 8
You can’t perform that action at this time.
0 commit comments