[clang] [Clang] Fix a crash when using ast-dump=json (PR #70224)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 10:44:13 PDT 2023


================
@@ -217,21 +221,21 @@ void i();
 // CHECK-NEXT:    "id": "0x{{.*}}",
 // CHECK-NEXT:    "kind": "FunctionTemplateDecl",
 // CHECK-NEXT:    "loc": {
-// CHECK-NEXT:     "offset": {{[0-9]+}},
+// CHECK-NEXT:     "offset": 142,
----------------
elizabethandrews wrote:

It looks like all the script does is dump the output of `-ast-dump=json` without really checking the string. Theoretically I guess it would be possible to check for "offset" in this string and modifying what is generated, but I haven't worked with Python in years and so might not be the best person to do this update. I think this should also be done in a separate patch since it falls outside the scope of this patch. 

For now I can revert the offset changes the script made and just keep the new CHECK lines with offsets modified? Would you be ok with that? Tagging @llvm-beanz for any input as well.

https://github.com/llvm/llvm-project/pull/70224


More information about the cfe-commits mailing list