Prevent assertions outside sections from crashing

This commit is contained in:
ISSOtm
2020-03-29 12:18:24 +02:00
parent db1eb8fbcb
commit a3d8836671
8 changed files with 25 additions and 9 deletions

View File

@@ -362,7 +362,7 @@ bool out_CreateAssert(enum AssertionType type, struct Expression const *expr,
static void writeassert(struct Assertion *assert, FILE *f)
{
writepatch(assert->patch, f);
fputlong(getsectid(assert->section), f);
fputlong(assert->section ? getsectid(assert->section) : -1, f);
fputstring(assert->message, f);
}