forked from OSchip/llvm-project
[ORC] Destroy FinalizeErr if there is a serialization error.
If there is a serialization error then FinalizeErr should never be set, so we can use cantFail rather than consumeError here.
This commit is contained in:
parent
8abf46d39a
commit
4fc2a4cc01
|
@ -63,9 +63,10 @@ public:
|
|||
Parent.SAs.Finalize,
|
||||
[OnFinalize = std::move(OnFinalize)](Error SerializationErr,
|
||||
Error FinalizeErr) {
|
||||
if (SerializationErr)
|
||||
if (SerializationErr) {
|
||||
cantFail(std::move(FinalizeErr));
|
||||
OnFinalize(std::move(SerializationErr));
|
||||
else
|
||||
} else
|
||||
OnFinalize(std::move(FinalizeErr));
|
||||
},
|
||||
Parent.SAs.Allocator, std::move(FR));
|
||||
|
|
Loading…
Reference in New Issue