Open Bug 1329531 Opened 7 years ago Updated 2 years ago

Export JSPropertyDescriptor structure to allow calling it's methods from external executables.

Categories

(Core :: JavaScript Engine, defect, P3)

45 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: dimka.kozlov, Unassigned)

Details

(Keywords: triage-deferred)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36

Steps to reproduce:

I am embedding SpiderMonkey, release 45. We are using following functions to manage heap allocated pointers:

JS_CallScriptTracer(tracer, (JS::Heap<JSScript*>*)data, "jsscript");
JS_CallValueTracer(tracer, (JS::Heap<JS::Value>*)data, "jsscopevalue");
JS_AddExtraGCRootsTracer(...);

I believe these are causing calls to a static method JSPropertyDescriptor::trace(JSPropertyDescriptor* self, JSTracer* trc). The method defined as inline and calls a member JSPropertyDescriptor::function trace(JSTracer*).

JSPropertyDescriptor is not exported by libmozjs-45.so, hence we are getting a linker error:

In function 'JSPropertyDescriptor::trace(JSPropertyDescriptor*, JSTracer*)':
.../spidermonkey-45.0.2-40283/include/jsapi.h:2413: undefined reference to 'JSPropertyDescriptor::trace(JSTracer*)'

Exporting JSPropertyDescriptor structure fixes the problem.

Same problem may happen with struct StackShape.
Keywords: triage-deferred
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.