<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56380>56380</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang Analysis inputs (expected plists) contain invalid property-list syntax
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kulp
      </td>
    </tr>
</table>

<pre>
    Some plists (at least the following two) contain consecutive `<key>...</key>` entries, which are invalid plist syntax, according to the `plutil` on my M1 MacBook with macOS Monterey 12.3.1.

https://github.com/llvm/llvm-project/blob/7a14244cc645bbbcbf5056e7a00fadbb339e92ed/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist#L4-L7

https://github.com/llvm/llvm-project/blob/7a14244cc645bbbcbf5056e7a00fadbb339e92ed/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc.plist#L4-L7

`plutil -lint` detects the problem, but locates it wrong:
```
$ plutil -lint llvm-project/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist 
llvm-project/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist: Found non-key inside <dict> at line 26357
```

`plutil -convert` fails to convert the file:
```
$ plutil -convert json -o p.json llvm-project/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist
-project/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objcpp.plist: Property List error: Found non-key inside <dict> at line 26357 / JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.
$ echo $?
1
$ ls -l p.json
ls: p.json: No such file or directory
```

Removing line five from either file causes the operations above to succeed.
```
$ for f in llvm-project/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc*.plist; do sed 5d $f | plutil -lint -; done
<stdin>: OK
<stdin>: OK
$ for f in llvm-project/clang/test/Analysis/Inputs/expected-plists/retain-release.m.objc*.plist; do sed 5d $f | plutil -convert json - -o - | wc -c; done
  235845
  236204
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVttu2zgQ_Rr5ZSCBuln2gx4StwZ2N2mK5gsocmQzoUSBpOz473co2XUTtEULNMAuIIj3mXPmRjZGnupH0yEMWjnvIMpW3ING7jz4PUJrtDZH1e_AH02UrUGY3nPVh9ahGL06IERLFuWbZzxF-cckSagfZdt5SEuAvbcKXZRt4LhXYg_cIqj-wLWSs15wJ5L6EnZwIYyVk0IzISAJgyY9OogyPXQnuE_hnotbY57hqPweOi4eHuGekKHFE6RZkidpErEPEbuZ_3vvBxflN4SLvh0dGptEmI4GWh8uTTxY84TC07DRpqGm4mmRFYUQy6JsmkY0bcnKJVacsZbLpsnzNa4zlLRVaN7vqPXogoCbnuuTU8R6-1c_jD508GUg6Sjj2dg0YzEYM7YYLI5Jl5jmSQxDMm2IsvyuiO-q_y2RH9P46lSItep9cK1ETzLd5HOC32jsQjw0I4WjEZzQgPJwtIbA5Vcx528eZgV8Kxbe2OLPuwhmxe-uhxjD1oy9hN70MaUW5Y9TkrIj30hFSvOPEPJW9QjZMi-r79vnre0piQ9oJ_O3XGkXcu48N2e_0vgrxr6ceXKUoLGBIZl672-WCcm7W_6zNQPRO8FdcDlaa-xvO4Qq6xb-fnz4dD0_jTy-eJAqyKEy6DlZcapp3Fp-AmOBwBBe4KTKDF6RWclJPFRlaC3fdVRd3XwYfULHJlCT3jTkjzB67HpgydVrKPaG4BRRvp0n0-saxUCsz_47x3YoN5cZ6n0y4EYq4iE2Aj6pLOEz9vSTkPuCnTmEmj7hasOd0VrTARJTtLMowUeHc_oHa_NA1QFvDG32k06BKJMfxmJLWFrywvtFXZTdXGLiFiRBQgmlDJZsIao2r0tPPG_q8Yww3zhP11q4EsmID__8fPo_xed1dof8jqf1o6C11zQBsrxcFeV1tMxY8cZnC1nncp2v-cIrr7HeBEZwIUKUA43wErnwgAuP6_Pj6_PhnJrxN8-IxWh1_dsXpXJuDI-UbbnMV2yxr1vJ27RivEqlXKWMNTlLWVOWmFeIlSgWmjeoXR2Vt1H5YaHqjGUZq1jJViVLi4TarF2v2zZt13Ips6hg2FGVTYLixNjdwtYThmbcOVqcOF4XuXNq1yNe5PPR742tn0c9LCas9QT0X19jKEs">