JsonReports.ml: fix --report-force-relative-path being ignored (#1640)
JsonReports.ml: fix --report-force-relative-path being ignored (#1640)

Summary:
This commit fixes an issue originally found through AdaCore's Ada
frontend for infer, but which is actually present for other frontends
too.

The issue is that infer will sometimes emit absolute paths in its JSON
report file despite --report-force-relative-path being present on the
command line. This issue can be reproduced with infer's C frontend like
this:

mkdir -p repro/child
cd repro/child
cat > ../file.c <<EOF
void main() {
  int A, B = 1;
  A = A + B;
}
EOF
cat > Makefile <<EOF
all: ../file.c
	gcc ../file.c
EOF
infer run --report-force-relative-path --quiet -- make
grep -o '"file[^"]*":"[^"]*"' infer-out/report.json

Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for how to set up your development environment and run tests.

Pull Request resolved: https://github.com/facebook/infer/pull/1640

Reviewed By: ngorogiannis

Differential Revision: D39056785

Pulled By: jvillard

fbshipit-source-id: 96077fa316baa6a18fe676f004e77ffdec329c19

facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer,facebook/infer