File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ LLVMRustDestroyArchive(RustArchive *ar) {
73
73
struct RustArchiveIterator {
74
74
Archive::child_iterator cur;
75
75
Archive::child_iterator end;
76
+ #if LLVM_VERSION_MINOR >= 9
77
+ Error err;
78
+ #endif
76
79
};
77
80
78
81
extern " C" RustArchiveIterator*
@@ -82,15 +85,24 @@ LLVMRustArchiveIteratorNew(RustArchive *ra) {
82
85
#if LLVM_VERSION_MINOR <= 8
83
86
rai->cur = ar->child_begin ();
84
87
#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
+ }
87
93
#endif
88
94
rai->end = ar->child_end ();
89
95
return rai;
90
96
}
91
97
92
98
extern " C" const Archive::Child*
93
99
LLVMRustArchiveIteratorNext (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
94
106
if (rai->cur == rai->end )
95
107
return NULL ;
96
108
#if LLVM_VERSION_MINOR == 8
You can’t perform that action at this time.
0 commit comments