Open Bug 1536134 Opened 6 years ago Updated 3 years ago

Static analysis seems to miss some expressions on some platforms

Categories

(Developer Infrastructure :: Source Code Analysis, defect, P2)

Tracking

(Not tracked)

People

(Reporter: bzbarsky, Unassigned)

Details

STEPS TO REPRODUCE:

  1. Mark the lambda at https://searchfox.org/mozilla-central/rev/4763b8d576ce52625d245d1ab6d9404ea025b026/dom/base/PlacesObservers.cpp#286 MOZ_CAN_RUN_SCRIPT_BOUNDARY.
  2. Compile in dom/base with --enable-clang-plugin.

EXPECTED RESULTS: Nothing exciting.

ACTUAL RESULTS:

 0:00.78 In file included from Unified_cpp_dom_base3.cpp:137:
 0:00.78 /home/bzbarsky/mozilla/vanilla/mozilla/dom/base/PlacesObservers.cpp:291:11: warning: Declaration has unhandled annotations.
 0:00.78           MOZ_CAN_RUN_SCRIPT_BOUNDARY { cb->Call(aEvents); });
 0:00.78           ^
 0:00.78 ../../dist/include/mozilla/Attributes.h:753:62: note: expanded from macro 'MOZ_CAN_RUN_SCRIPT_BOUNDARY'
 0:00.78       __attribute__((annotate("moz_can_run_script_boundary")))
 0:00.78                                                              ^

(ignore the line numbers not matching up; I have other patches in my tree that shift those).

But this only happens on Mac and Linux. On Windows, the annotation is handled.

As a result, if "cb->Call" is MOZ_CAN_RUN_SCRIPT and the lambda is NOT annotated in any way, the analysis passes on Linux and Mac, but on Windows complains about a call to a MOZ_CAN_RUN_SCRIPT thing from a non-MOZ_CAN_RUN_SCRIPT function.

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

Flags: needinfo?(sledru)
Flags: needinfo?(sledru)
Priority: -- → P2
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.