Replace assert with assume for release build optimization (#1390)

This commit is contained in:
Sylvie
2024-04-02 11:09:31 -04:00
committed by GitHub
parent 1d39e5ed56
commit a234da42a6
26 changed files with 158 additions and 147 deletions

View File

@@ -2,7 +2,6 @@
#include "link/section.hpp"
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
@@ -183,7 +182,7 @@ static void mergeSections(Section &target, std::unique_ptr<Section> &&other, Sec
for (Patch &patch : other->patches)
patch.pcOffset += other->offset;
} else if (!target.data.empty()) {
assert(other->size == 0);
assume(other->size == 0);
}
break;