Closed Bug 1562787 Opened 4 months ago Closed 4 months ago

Improve style struct size assertions.

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

Attachments

(1 file)

No description provided.

This will display something like:

error: static_assert failed due to requirement '528UL <= 504UL' "Style struct became larger than the size limit"
static_assert(Actual <= Limit, "Style struct became larger than the size limit");
^             ~~~~~~~~~~~~~~~
note: in instantiation of template class 'AssertSizeIsLessThan<nsStylePosition, 528, 504>' requested here
STYLE_STRUCT_RESET(Position)
^
note: expanded from macro 'STYLE_STRUCT_RESET'
		     ^
note: expanded from macro 'STYLE_STRUCT'
static_assert(AssertSizeIsLessThan<nsStyle##name_, sizeof(nsStyle##name_), kStyleStructSizeLimit>::instantiate, "");

Which includes both the size, the limit, and the struct name, as opposed to the
current:

error: static_assert failed due to requirement 'sizeof(nsStylePosition) <= kStyleStructSizeLimit' "nsStylePosition became larger than the size limit"
STYLE_STRUCT_RESET(Position)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: expanded from macro 'STYLE_STRUCT_RESET'
		     ^~~~~~~~~~~~~~~~~~
note: expanded from macro 'STYLE_STRUCT'
static_assert(sizeof(nsStyle##name_) <= kStyleStructSizeLimit, \

Which only includes the name and thus isn't very useful.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e1cc6ea96d6c
Improve style struct size assertion messages. r=boris
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.