Add static_assert reminder to increment XDR_BYTECODE_VERSION_SUBTRAHEND when extending js.msg

RESOLVED FIXED in mozilla37

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: cpeterson, Assigned: cpeterson)

Tracking

unspecified
mozilla37
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
In bug 1102131, I added two new warning MSG_DEFs to js.msg but forgot to increment XDR_BYTECODE_VERSION_SUBTRAHEND. This patch adds a static_assert to Xdr.h that fails if MSG_DEFs are added or removed to js.msg, reminding developers to update XDR_BYTECODE_VERSION_SUBTRAHEND.
Attachment #8531921 - Flags: review?(shu)

Comment 1

4 years ago
Comment on attachment 8531921 [details] [diff] [review]
xdr-version-assert.patch

Review of attachment 8531921 [details] [diff] [review]:
-----------------------------------------------------------------

Nice.

Could you prefix the static assert message with "GREETINGS, POTENTIAL SUBTRAHEND INCREMENTER!" though?
Attachment #8531921 - Flags: review?(shu) → review+
(Assignee)

Comment 6

4 years ago
#included "jsfriendapi.h" for JSErr_Limit definition in non-unified builds:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e448025c6dad
https://hg.mozilla.org/mozilla-central/rev/e448025c6dad
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Chris, why is it necessary to bump the version number when error messages are added?
Flags: needinfo?(cpeterson)
We burn error message numbers into our self-hosted JS.  Do a

  ThrowError(JSMSG_BAD_SYMBOL, v);

with an error number added or removed before it (i.e. pretty much anywhere), and bytecode will have a stale error number in it, and arity will be off, and blah blah blah.  This is compounded by js.msg's reordering to group messages in similar functionality.
Flags: needinfo?(cpeterson)
Thanks, Jeff.
You need to log in before you can comment on or make changes to this bug.