Skip to content

Commit 30537fb

Browse files
marcaubererT0b1-iOS
authored andcommitted
[TPDE] Do not assert completed write in FunctionWriter dtor
In an OOM situation it is not guaranteed that `flush()` is called on the FunctionWriter, before destroying it. Change-Id: I29e6754e1fc9f4ca655de710e9306d6bf00e9791
1 parent 6ca9d23 commit 30537fb

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

tpde/include/tpde/FunctionWriter.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ class FunctionWriterBase {
127127
protected:
128128
FunctionWriterBase(const TargetCIEInfo &cie_info) : cie_info(cie_info) {}
129129

130-
~FunctionWriterBase() {
131-
assert(data_cur == data_reserve_end &&
132-
"must flush section writer before destructing");
133-
}
134-
135130
public:
136131
/// Get the SecRef of the current section.
137132
SecRef get_sec_ref() const { return get_section().get_ref(); }

tpde/src/FunctionWriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ void FunctionWriterBase::end_module() {
2929
*reinterpret_cast<u32 *>(eh_writer.data() + fde_start) += 4;
3030
}
3131
eh_writer.flush();
32+
33+
assert(data_cur == data_reserve_end);
3234
}
3335

3436
void FunctionWriterBase::begin_func() {

0 commit comments

Comments
 (0)