ubsan: member access within null pointer of union

Add some nonsense to cover "undefined behaviour".

	* ldlang.c (section_for_dot): Avoid UB.
This commit is contained in:
Alan Modra 2022-04-12 21:50:09 +09:30
parent 1b35e577c3
commit 10c0005660

View file

@ -6726,7 +6726,7 @@ section_for_dot (void)
if (stmt->header.type == lang_output_section_statement_enum)
break;
os = &stmt->output_section_statement;
os = stmt ? &stmt->output_section_statement : NULL;
while (os != NULL
&& !os->after_end
&& (os->bfd_section == NULL