I am currently upgrading from Spidermonkey 1.8.5 to 115.
A pretty big change, and until I reached this issue everything was fine.
A simple example of what I am trying to achieve:
1. Create global object “globalA”
2. Enter realm with JS::AutoRealm arA(cx, globalA)
3. Compile JSScript “testScript” with JS::Compile(cx, options, code)
4. Store “testScript” in JS::Heap
>>> program executes for some time until “testScript” is needed
5. Create global object “globalB” which has “globalA” as its prototype
6. Enter realm with JS::AutoRealm arB(cx, globalB)
7. Execute “testScript” with JS_ExecuteScript(cx, testScript, &retval)
The result of running the example above is segmentation fault with crash reason “Realm mismatch”.
I am wondering if anyone has encountered similar issue or know a way for this to work?
If needed, I can share implementation example and a crash backtrace.