Browse Source

Merge pull request #1540 from svaarala/fix-debugger-proplist

Fix debugger GetHeapObjInfo property list
pull/1381/merge
Sami Vaarala 8 years ago
committed by GitHub
parent
commit
2752bcd6fb
  1. 3
      RELEASES.rst
  2. 8
      src-input/duk_debugger.c

3
RELEASES.rst

@ -2873,6 +2873,9 @@ Planned
* Add a wrap check to duk_{check,require}_stack{_top}() (GH-1537)
* Fix potential segfault in debugger GetHeapObjInfo command, caused by
key/mask list being out of sync (GH-1540)
* Fix Reflect.construct() handling for four or more arguments (GH-1517,
GH-1518)

8
src-input/duk_debugger.c

@ -1914,7 +1914,7 @@ DUK_LOCAL const char * const duk__debug_getinfo_hobject_keys[] = {
"newenv",
"namebinding",
"createargs",
"have_finalizer"
"have_finalizer",
"exotic_array",
"exotic_stringobj",
"exotic_arguments",
@ -1984,7 +1984,7 @@ DUK_LOCAL void duk__debug_getinfo_bitmask(duk_hthread *thr, const char * const *
for (;;) {
mask = *masks++;
if (!mask) {
if (mask == 0) {
break;
}
key = *keys++;
@ -2066,6 +2066,10 @@ DUK_LOCAL void duk__debug_handle_get_heap_obj_info(duk_hthread *thr, duk_heap *h
DUK_D(DUK_DPRINT("debug command GetHeapObjInfo"));
DUK_UNREF(heap);
DUK_ASSERT(sizeof(duk__debug_getinfo_hstring_keys) / sizeof(const char *) == sizeof(duk__debug_getinfo_hstring_masks) / sizeof(duk_uint_t) - 1);
DUK_ASSERT(sizeof(duk__debug_getinfo_hobject_keys) / sizeof(const char *) == sizeof(duk__debug_getinfo_hobject_masks) / sizeof(duk_uint_t) - 1);
DUK_ASSERT(sizeof(duk__debug_getinfo_hbuffer_keys) / sizeof(const char *) == sizeof(duk__debug_getinfo_hbuffer_masks) / sizeof(duk_uint_t) - 1);
h = duk_debug_read_any_ptr(thr);
if (!h) {
duk_debug_write_error_eom(thr, DUK_DBG_ERR_UNKNOWN, "invalid target");

Loading…
Cancel
Save