If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Automatically detect JSAPI header-library mismatches

RESOLVED DUPLICATE of bug 474873

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 474873
9 years ago
9 years ago

People

(Reporter: jorendorff, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
A source of headaches for embedders is accidentally #including the wrong jsapi.h or linking against the wrong SpiderMonkey shared library.  The resulting behavior can be bizarre and extremely hard to track down (particularly if we've changed something like the bit-encoding of jsvals, as we did between 1.7 and 1.8).

We should detect this mistake at run time.  JS_NewRuntime can be a function-like macro that adds a parameter to the actual library call.  The added parameter is a constant, an int cookie identifying the SM version and any ABI-relevant configure options (such as --enable-threadsafe).  JS_NewRuntime should print a warning and return NULL if the version number passed in (i.e. the ABI id in the jsapi.h seen by the caller) is not exactly the library's version number (i.e. the ABI id seen by jsapi.cpp when SpiderMonkey was built).
Isn't this a dup of bug 474873 ?

/be
(Reporter)

Updated

9 years ago
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 474873
You need to log in before you can comment on or make changes to this bug.