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

UNCONFIRMED
Unassigned

Status

()

Core
JavaScript Engine
P3
normal
UNCONFIRMED
a year ago
7 months ago

People

(Reporter: Dmitri, Unassigned)

Tracking

({triage-deferred})

45 Branch
triage-deferred
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
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
You need to log in before you can comment on or make changes to this bug.