facebookarchive / facebook-clang-plugins

Plugins to clang-analyzer and clang-frontend
MIT License
483 stars 85 forks source link

Potentially already fixed: `"!!DUMMY!!"` appearing in the dumped AST #19

Closed aytey closed 4 years ago

aytey commented 4 years ago

Hello,

I am currently working with two versions of Infer:

However, I think that this is a facebook-clang-plugins issue, rather than an Infer issue.

Behind the scenes, I believe that the official release of Infer is using:

while my development release is using:

I then have the following script:

#!/bin/bash

set -eu

cat << EOF > test.c
void foo(int x)
{
    if (x);
}
EOF

infer -g -- gcc -c test.c

bash test.c.ast.sh

# EOF

which attempts to dump the AST.

When using the "official" release of Infer, the generated output contains things like the following:

({ "pointer": 1, "source_range": ({ }, { }), "!!DUMMY!!": unit },

that is, it has a dictionary entry with a key of "!!DUMMY!!" and an (unquoted) value of unit.

However, when using the development version of Infer, I do not see these "!!DUMMY!!" (which is great!).

Is this an older bug that is fixed in later versions of Infer?

jvillard commented 4 years ago

Hello, sorry I didn't reply sooner. The "!!DUMMY!!" nodes are expected and harmless. They just mean the frontend was unable to compute precisely how many fields it was about to dump and overshot a bit. As such, they are not bugs. Hope that answers your question.