Mostly making parts conditional and removing blocks that are no longer
applicable, and a few minor edits otherwise to update links and text.
Resolves#1722
- Use some pointer voodoo and instead of stringbuffer append()
- Use a lookup table instead of char comparisons for chr < 256
- Stop using a Hashtable/MovableCellHasher for JSON CycleDetector
This had been initially dealt with in issue #1699's commits, but one of them
was in the end reverted, which caused this problem (this change should have
been done there).
Defining _POSIX_C_SOURCE to 199309L on FreeBSD causes compile errors, because of
an obscure interaction between system wrappers and libc++ headers. The source
doesn't seem to need it at all, which tests confirm.
I bet that this is not needed either on other modern systems (even those based
on glibc), and that the define could probably be entirely removed. Not trying
it because I can't test it myself.
New FreeBSD versions have introduced RTLD_DEEPBIND (see dlopen(3)), which
triggers a provoked build error to be on the "safe" side.
Indeed, improper use of RTLD_DEEPBIND could cause malloc interposing not to
work on specific libraries. This would happen for libraries that provide their
own malloc/free and exchange pointers with other libraries or the main program,
one allocating an area and another one deallocating it.
It seems it happened for glibc, which is not a concern on FreeBSD, and for the
Flash Player (not a concern either, there is no native Flash Player). Moreover,
there is only a single reference to RTLD_DEEPBIND in the whole platform
currently, namely in the WebRTC code, but the corresponding code chunk is
compiled-in only on Linux (and this library doesn't seem to redefine malloc
functions anyway). So I don't see how a problem could happen. Additionally,
Pale Moon, which is my focus, doesn't use WebRTC.
Corresponding Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=493541
Including <cstdlib> must never trigger inclusion of "mozalloc.h", because the
first thing this one does is precisely to include <cstdlib>.
It is now the case that, in libc++ 9 and beyond, <cstdlib> includes <math.h>
which then tries to include <type_traits>, which the STL wrapper intercepts,
trying to load "mozalloc.h". Same problem happens with <limits>.
Fix pulled from: https://bugzilla.mozilla.org/show_bug.cgi?id=1594027.
This change makes unicode line and paragraph separators allowed in JS strings,
removing the only quirk of the JS string definition that made JSON not a valid
subset of JS.
Resolves#1732
With the changes to layout for WebComponents, it is now apparently possible to
pass in null for frame tree items to this function, which would cause a null
deref crash if not checked.
Transplanting objects is inherently oom-unsafe, so add
`AutoEnterOOMUnsafeRegion` to `JS_TransplantObject()` and annotate crashes
accordingly if they do happen.