Vitaly Buka 66e49e38ae
[YAML] Don't validate Fill::Size after error (#123280)
Size is required, so we don't know if it's in
uninitialized state after the previous error.

Triggers msan on llvm/test/tools/yaml2obj/ELF/custom-fill.yaml NOSIZE
test.

We have `Fill` Section with Pattern, but no size. Before the fix it
produced error:
```
YAML:169:5: error: missing required key 'Size'
  - Type:    Fill
    ^
YAML:169:5: error: "Size" can't be 0 when "Pattern" is not empty
  - Type:    Fill
```

The same applies to `MachOYAML::Section` fields `content` and `size`.
However `MachOYAML::Section` matches size first, so on error,
content is not set anyway. Added error checking just in case.
2025-01-23 09:52:34 -08:00
..