Bug 1593703 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

`Clang 5` has a serious problem when it generates the `AnnotateAttr` for a `Decl` it only supports a single annotation and the rest are dropped. In the case for `CheckedInt` we have present two annotations `MOZ_IMPLICIT` and `MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT` but only the later one is included into the `AST` node.
Let's take as an example `js/src/builtin/RegExp.cpp` we have 8 AST matches for `CheckedInt(U)` but only for the later one we have generated the sane `specific_attrs`. Also this behavior ranges from clang 5.0 - clang 6.0 and was fixed in 7.0.
`Clang 5` has a serious problem when it generates the `AnnotateAttr` for a `Decl` it only supports a single annotation and the rest are dropped. In the case for `CheckedInt` we have present two annotations `MOZ_IMPLICIT` and `MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT` but only the later one is included into the `AST` node.
Let's take as an example `js/src/builtin/RegExp.cpp` we have 8 AST matches for `CheckedInt(U)` but only for the later one we have generated the sane `specific_attrs`. Also this behavior ranges from clang 5.0 - clang 6.0 and was fixed in 7.0.
So this leads me to the concussion that right now we are dealing with a corrupt AST for a compilation unit, at least the one that is exposed to clang-tooling.

Back to Bug 1593703 Comment 3