[ELF] Postpone ASSERT error
assignAddresses is executed more than once. When an ASSERT expression evaluates to zero, we should only report an error for the last assignAddresses. Make a change similar to #66854 and #96361. This change might help https://github.com/ClangBuiltLinux/linux/issues/2094
This commit is contained in:
@@ -900,9 +900,9 @@ Expr ScriptParser::readAssert() {
|
||||
StringRef msg = readName();
|
||||
expect(")");
|
||||
|
||||
return [=, s = ctx.script, &ctx = ctx]() -> ExprValue {
|
||||
return [=, s = ctx.script]() -> ExprValue {
|
||||
if (!e().getValue())
|
||||
Err(ctx) << msg;
|
||||
s->recordError(msg);
|
||||
return s->getDot();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user