Commit 0f2aaee1 authored by Andrea Azzarone's avatar Andrea Azzarone

New upstream version 1.54.3

parents b84c6033 7d5e567b
Version 1.54.3
--------------
- Closed bugs and merge requests:
* object: Fix write-only properties [!246, Philip Chimento]
* SIGSEGV when exiting gnome-shell [#212, !247, Andrea Azzarone]
* SelectionData.get_targets crashes with "Unable to resize vector" [#201,
!241, Philip Chimento]
* Gnome-shell crashes on destroying cached param specs [#213, !240, Marco
Trevisan]
* GType memleak fixes [!244, Marco Trevisan]
* Fix build with --enable-dtrace and create CI job to ensure it doesn't break
in the future [#196, !253, Philip Chimento]
Version 1.54.2
--------------
......
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for gjs 1.54.2.
# Generated by GNU Autoconf 2.69 for gjs 1.54.3.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gjs>.
#
......@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='gjs'
PACKAGE_TARNAME='gjs'
PACKAGE_VERSION='1.54.2'
PACKAGE_STRING='gjs 1.54.2'
PACKAGE_VERSION='1.54.3'
PACKAGE_STRING='gjs 1.54.3'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gjs'
PACKAGE_URL='https://wiki.gnome.org/Projects/Gjs'
......@@ -1449,7 +1449,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures gjs 1.54.2 to adapt to many kinds of systems.
\`configure' configures gjs 1.54.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1519,7 +1519,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of gjs 1.54.2:";;
short | recursive ) echo "Configuration of gjs 1.54.3:";;
esac
cat <<\_ACEOF
......@@ -1697,7 +1697,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
gjs configure 1.54.2
gjs configure 1.54.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2248,7 +2248,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by gjs $as_me 1.54.2, which was
It was created by gjs $as_me 1.54.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3111,7 +3111,7 @@ fi
# Define the identity of the package.
PACKAGE='gjs'
VERSION='1.54.2'
VERSION='1.54.3'
cat >>confdefs.h <<_ACEOF
......@@ -3338,10 +3338,10 @@ ac_config_headers="$ac_config_headers config.h"
GJS_VERSION=15402
GJS_VERSION=15403
$as_echo "#define GJS_VERSION (1 * 100 + 54) * 100 + 2" >>confdefs.h
$as_echo "#define GJS_VERSION (1 * 100 + 54) * 100 + 3" >>confdefs.h
GETTEXT_PACKAGE=gjs
......@@ -23815,7 +23815,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by gjs $as_me 1.54.2, which was
This file was extended by gjs $as_me 1.54.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -23886,7 +23886,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
gjs config.status 1.54.2
gjs config.status 1.54.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -3,7 +3,7 @@
m4_define(pkg_major_version, 1)
m4_define(pkg_minor_version, 54)
m4_define(pkg_micro_version, 2)
m4_define(pkg_micro_version, 3)
m4_define(pkg_version, pkg_major_version.pkg_minor_version.pkg_micro_version)
m4_define(pkg_int_version, (pkg_major_version * 100 + pkg_minor_version) * 100 + pkg_micro_version)
......
......@@ -965,6 +965,16 @@ gjs_array_from_flat_gvalue_array(JSContext *context,
JS::MutableHandleValue value)
{
GValue *values = (GValue *)array;
// a null array pointer takes precedence over whatever `length` says
if (!values) {
JSObject* jsarray = JS_NewArrayObject(context, 0);
if (!jsarray)
return false;
value.setObject(*jsarray);
return true;
}
unsigned int i;
JS::AutoValueVector elems(context);
if (!elems.resize(length))
......@@ -2283,6 +2293,15 @@ gjs_array_from_carray_internal (JSContext *context,
if (element_type == GI_TYPE_TAG_UNICHAR)
return gjs_string_from_ucs4(context, (gunichar *) array, length, value_p);
// a null array pointer takes precedence over whatever `length` says
if (!array) {
JSObject* jsarray = JS_NewArrayObject(context, 0);
if (!jsarray)
return false;
value_p.setObject(*jsarray);
return true;
}
JS::AutoValueVector elems(context);
if (!elems.resize(length))
g_error("Unable to resize vector");
......
......@@ -63,13 +63,18 @@ update_gtype_weak_pointers(JSContext *cx,
void *data)
{
for (auto iter = weak_pointer_list.begin(); iter != weak_pointer_list.end(); ) {
auto heap_wrapper = static_cast<JS::Heap<JSObject *> *>(g_type_get_qdata(*iter, gjs_get_gtype_wrapper_quark()));
GType gtype = *iter;
auto heap_wrapper = static_cast<JS::Heap<JSObject *> *>(
g_type_get_qdata(gtype, gjs_get_gtype_wrapper_quark()));
JS_UpdateWeakPointerAfterGC(heap_wrapper);
/* No read barriers are needed if the only thing we are doing with the
* pointer is comparing it to nullptr. */
if (heap_wrapper->unbarrieredGet() == nullptr)
if (heap_wrapper->unbarrieredGet() == nullptr) {
g_type_set_qdata(gtype, gjs_get_gtype_wrapper_quark(), nullptr);
iter = weak_pointer_list.erase(iter);
delete heap_wrapper;
}
else
iter++;
}
......@@ -95,8 +100,12 @@ gjs_gtype_finalize(JSFreeOp *fop,
if (G_UNLIKELY(gtype == 0))
return;
weak_pointer_list.erase(gtype);
auto heap_wrapper = static_cast<JS::Heap<JSObject*>*>(
g_type_get_qdata(gtype, gjs_get_gtype_wrapper_quark()));
g_type_set_qdata(gtype, gjs_get_gtype_wrapper_quark(), NULL);
weak_pointer_list.erase(gtype);
delete heap_wrapper;
}
static bool
......
......@@ -287,7 +287,8 @@ GParamSpec* ObjectPrototype::find_param_spec_from_id(JSContext* cx,
gname = gjs_hyphen_from_camel(js_prop_name);
GObjectClass *gobj_class = G_OBJECT_CLASS(g_type_class_ref(m_gtype));
GjsAutoParam param_spec = g_object_class_find_property(gobj_class, gname);
GParamSpec* pspec = g_object_class_find_property(gobj_class, gname);
GjsAutoParam param_spec(pspec, GjsAutoParam::TakeOwnership());
g_type_class_unref(gobj_class);
g_free(gname);
......@@ -386,8 +387,10 @@ ObjectInstance::prop_getter_impl(JSContext *cx,
if (g_param_spec_get_qdata(param, ObjectInstance::custom_property_quark()))
return true;
if ((param->flags & G_PARAM_READABLE) == 0)
if ((param->flags & G_PARAM_READABLE) == 0) {
rval.setUndefined();
return true;
}
gjs_debug_jsprop(GJS_DEBUG_GOBJECT, "Accessing GObject property %s",
param->name);
......@@ -691,10 +694,7 @@ static bool is_ginterface_property_name(GIInterfaceInfo* info,
prop_info.reset();
}
if (!prop_info)
return false;
return g_property_info_get_flags(prop_info) & G_PARAM_READABLE;
return !!prop_info;
}
bool ObjectPrototype::lazy_define_gobject_property(JSContext* cx,
......@@ -812,14 +812,14 @@ is_gobject_property_name(GIObjectInfo *info,
return true;
}
}
g_free(canonical_name);
return false;
}
g_free(canonical_name);
if (!prop_info)
return false;
return g_property_info_get_flags(prop_info) & G_PARAM_READABLE;
return true;
}
bool ObjectBase::resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
......@@ -1618,7 +1618,7 @@ void ObjectBase::finalize(JSFreeOp* fop, JSObject* obj) {
ObjectInstance::~ObjectInstance() {
debug_lifecycle("Finalize");
TRACE(GJS_OBJECT_PROXY_FINALIZE(priv, m_gobj, ns(), name()));
TRACE(GJS_OBJECT_PROXY_FINALIZE(this, m_gobj, ns(), name()));
invalidate_all_closures();
......
......@@ -291,8 +291,12 @@ from_gbytes_func(JSContext *context,
}
JSObject* gjs_byte_array_from_data(JSContext* cx, size_t nbytes, void* data) {
JS::RootedObject array_buffer(
cx, JS_NewArrayBufferWithContents(cx, nbytes, g_memdup(data, nbytes)));
JS::RootedObject array_buffer(cx);
// a null data pointer takes precedence over whatever `nbytes` says
if (data)
array_buffer = JS_NewArrayBufferWithContents(cx, nbytes, g_memdup(data, nbytes));
else
array_buffer = JS_NewArrayBuffer(cx, 0);
if (!array_buffer)
return nullptr;
......
......@@ -162,7 +162,7 @@ gjs_finalize_callback(JSFreeOp *fop,
code, so we can probably rely on this behavior.
*/
if (status == JSFINALIZE_GROUP_START)
if (status == JSFINALIZE_GROUP_PREPARE)
_gjs_context_set_sweeping(js_context, true);
else if (status == JSFINALIZE_GROUP_END)
_gjs_context_set_sweeping(js_context, false);
......
......@@ -278,6 +278,12 @@ gjs_string_from_ucs4(JSContext *cx,
ssize_t n_chars,
JS::MutableHandleValue value_p)
{
// a null array pointer takes precedence over whatever `n_chars` says
if (!ucs4_string) {
value_p.setString(JS_GetEmptyString(cx));
return true;
}
long u16_string_length;
GError *error = NULL;
......
......@@ -86,10 +86,13 @@ struct GCPolicy<GjsAutoInfo<T>> : public IgnoreGCPolicy<GjsAutoInfo<T>> {};
class GjsAutoParam
: public std::unique_ptr<GParamSpec, decltype(&g_param_spec_unref)> {
public:
struct TakeOwnership {};
GjsAutoParam(GParamSpec* ptr = nullptr)
: unique_ptr(ptr, g_param_spec_unref)
{
}
: unique_ptr(ptr, g_param_spec_unref) {}
GjsAutoParam(GParamSpec* ptr, const TakeOwnership&)
: GjsAutoParam(ptr ? g_param_spec_ref(ptr) : nullptr) {}
operator GParamSpec*() { return get(); }
};
......
# Valgrind suppressions file for GJS
# This is intended to be used in addition to GLib's glib.supp file.
# We leak a small wrapper in GJS for each registered GType.
{
gtype-wrapper-new
Memcheck:Leak
match-leak-kinds: definite
fun:_Znwm
fun:gjs_gtype_create_gtype_wrapper
}
{
gtype-wrapper-qdata
Memcheck:Leak
match-leak-kinds: possible
...
fun:type_set_qdata_W
fun:g_type_set_qdata
fun:gjs_gtype_create_gtype_wrapper
}
{
g_type_register_fundamental never freed
Memcheck:Leak
fun:calloc
...
fun:g_type_register_fundamental
...
}
# SpiderMonkey leaks
{
......
# SpiderMonkey leaks a mutex for each GC helper thread.
leak:js::HelperThread::threadLoop
# We leak a small wrapper in GJS for each registered GType.
leak:gjs_gtype_create_gtype_wrapper
# https://bugs.freedesktop.org/show_bug.cgi?id=105466
leak:libfontconfig.so.1
......
......@@ -234,6 +234,16 @@ describe('Introspected GObject', function () {
expect(obj.name_conflict).toEqual(42);
expect(obj.name_conflict instanceof Function).toBeFalsy();
});
xit('sets write-only properties', function () {
expect(obj.int).not.toEqual(0);
obj.write_only = true;
expect(obj.int).toEqual(0);
});
it('gives undefined for write-only properties', function () {
expect(obj.write_only).not.toBeDefined();
});
});
describe('Introspected function length', function () {
......
......@@ -13,7 +13,7 @@
#define GETTEXT_PACKAGE "gjs"
/* The gjs version as an integer */
#define GJS_VERSION 15402
#define GJS_VERSION 15403
/* define if the compiler supports basic C++11 syntax */
#define HAVE_CXX11 1
......@@ -74,7 +74,7 @@
#define PACKAGE_NAME "gjs"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "gjs 1.54.2"
#define PACKAGE_STRING "gjs 1.54.3"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gjs"
......@@ -83,10 +83,10 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.54.2"
#define PACKAGE_VERSION "1.54.3"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.54.2"
#define VERSION "1.54.3"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment